summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-30 16:43:10 -0700
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-04-17 16:15:59 -0400
commit9f1dd99a0eb80d2c1e93682c766bcddbdf42f30f (patch)
treeb5df380e3cfd6af28b83ede3d1d027789da1e67e /net
parent97d39ebaca2fd0c694b9695daef218b9c1af5971 (diff)
downloadlinux-stable-9f1dd99a0eb80d2c1e93682c766bcddbdf42f30f.tar.gz
linux-stable-9f1dd99a0eb80d2c1e93682c766bcddbdf42f30f.tar.bz2
linux-stable-9f1dd99a0eb80d2c1e93682c766bcddbdf42f30f.zip
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: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/socket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/socket.c b/net/socket.c
index 5e8d0af3c0e7..c63ebf4e31b5 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1672,6 +1672,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;
@@ -1729,6 +1731,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;