aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-30 16:43:10 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2011-03-21 12:44:15 -0700
commit47f407ec1fa2d0b5a785ecb19dc124bdba40ca20 (patch)
tree54493b76a8128df3d337cb8d3b4d9c2cdb7ff5a3
parent4f098248b8f55a27598eccac90d39b94e2dc78cd (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>
-rw-r--r--net/socket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/socket.c b/net/socket.c
index 769c386bd42..80e0a4f2d06 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1671,6 +1671,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;
@@ -1728,6 +1730,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;