]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
net: Truncate recvfrom and sendto length to INT_MAX.
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 30 Oct 2010 23:43:10 +0000 (16:43 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 21 Mar 2011 19:44:15 +0000 (12:44 -0700)
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>
net/socket.c

index 769c386bd4288758635acde6ca77c401a49c61a8..80e0a4f2d06fc4c6df12f745e32c099e34b8dd83 100644 (file)
@@ -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;