diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-30 16:43:10 -0700 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2010-12-14 23:40:16 +0100 |
commit | 8fb9ee234b8283ced0b5d47c26739144a254a1ed (patch) | |
tree | 875eb90cfabdf2576d92a25ec9736748cf145d87 | |
parent | 32005932e9aa0c2b97fd817edde2dff1c5640734 (diff) |
net: Truncate recvfrom and sendto length to INT_MAX.
commit 253eacc070b114c2ec1f81b067d2fed7305467b0 upstream.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rw-r--r-- | net/socket.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/socket.c b/net/socket.c index 367d5477d00..166ad32f944 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1652,6 +1652,8 @@ SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len, struct iovec iov; int fput_needed; + if (len > INT_MAX) + len = INT_MAX; sock = sockfd_lookup_light(fd, &err, &fput_needed); if (!sock) goto out; @@ -1709,6 +1711,8 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size, int err, err2; int fput_needed; + if (size > INT_MAX) + size = INT_MAX; sock = sockfd_lookup_light(fd, &err, &fput_needed); if (!sock) goto out; |