Commit b8517017 authored by Olaf Kirch's avatar Olaf Kirch Committed by David S. Miller

[NET]: Fix CMSG_COMPAT_OK length check.

Need to check against struct compat_cmsghdr
not struct cmsghdr.
Signed-off-by: default avatarOlaf Kirch <okir@suse.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8bcfd3cc
......@@ -125,7 +125,7 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
(struct compat_cmsghdr __user *)NULL)
#define CMSG_COMPAT_OK(ucmlen, ucmsg, mhdr) \
((ucmlen) >= sizeof(struct cmsghdr) && \
((ucmlen) >= sizeof(struct compat_cmsghdr) && \
(ucmlen) <= (unsigned long) \
((mhdr)->msg_controllen - \
((char *)(ucmsg) - (char *)(mhdr)->msg_control)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment