diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-30 16:43:10 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-09 13:33:27 -0800 |
commit | 66e854dde3739a30d11accba63a45ce8a7ac02be (patch) | |
tree | 4e710aecf693f9f77c693e4bcd57c1adba8eb007 /net | |
parent | 218419257881202b6ff446b48eb9a968e516dc2a (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>
Diffstat (limited to 'net')
-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 2270b941bcc7..58dfc915a3a5 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1651,6 +1651,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; @@ -1708,6 +1710,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; |