diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-06-07 05:09:05 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-06-07 05:09:05 +0400 |
commit | 1612e111e4e565422242727efb59499cce8738e4 (patch) | |
tree | 83c9db56186ab66fdb17c946944cba870665cfc5 /net/compat.c | |
parent | e2b02e25c5e9c2b5c8da22d8ca7efadc1b4e5468 (diff) | |
parent | a7526eb5d06b0084ef12d7b168d008fcf516caab (diff) | |
download | linux-1612e111e4e565422242727efb59499cce8738e4.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fix from David Miller:
"This is a quick one commit pull request to cure the regression
introduced by the MSG_CMSG_COMPAT change."
(Background: commit 1be374a0518a completely broke 32-bit COMPAT handling
by not only disallowing MSG_CMSG_COMPAT from user APIs, but clearing it
in our own internal use too!)
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
net: Unbreak compat_sys_{send,recv}msg
Diffstat (limited to 'net/compat.c')
-rw-r--r-- | net/compat.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/net/compat.c b/net/compat.c index 79ae88485001..f0a1ba6c8086 100644 --- a/net/compat.c +++ b/net/compat.c @@ -734,19 +734,25 @@ static unsigned char nas[21] = { asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, unsigned int flags) { - return sys_sendmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); + if (flags & MSG_CMSG_COMPAT) + return -EINVAL; + return __sys_sendmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); } asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg, unsigned int vlen, unsigned int flags) { + if (flags & MSG_CMSG_COMPAT) + return -EINVAL; return __sys_sendmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, flags | MSG_CMSG_COMPAT); } asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, unsigned int flags) { - return sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); + if (flags & MSG_CMSG_COMPAT) + return -EINVAL; + return __sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); } asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len, unsigned int flags) @@ -768,6 +774,9 @@ asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, int datagrams; struct timespec ktspec; + if (flags & MSG_CMSG_COMPAT) + return -EINVAL; + if (COMPAT_USE_64BIT_TIME) return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, flags | MSG_CMSG_COMPAT, |