diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-30 19:43:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-30 19:44:07 -0400 |
commit | 253eacc070b114c2ec1f81b067d2fed7305467b0 (patch) | |
tree | cf55d167c9a1a3fac2b7796f046674a53fbf47b0 /net | |
parent | d139ff0907dac9ef72fb2cf301e345bac3aec42f (diff) |
net: Truncate recvfrom and sendto length to INT_MAX.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
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 abf3e2561521..2808b4db46ee 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -1652,6 +1652,8 @@ SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len, | |||
1652 | struct iovec iov; | 1652 | struct iovec iov; |
1653 | int fput_needed; | 1653 | int fput_needed; |
1654 | 1654 | ||
1655 | if (len > INT_MAX) | ||
1656 | len = INT_MAX; | ||
1655 | sock = sockfd_lookup_light(fd, &err, &fput_needed); | 1657 | sock = sockfd_lookup_light(fd, &err, &fput_needed); |
1656 | if (!sock) | 1658 | if (!sock) |
1657 | goto out; | 1659 | goto out; |
@@ -1709,6 +1711,8 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size, | |||
1709 | int err, err2; | 1711 | int err, err2; |
1710 | int fput_needed; | 1712 | int fput_needed; |
1711 | 1713 | ||
1714 | if (size > INT_MAX) | ||
1715 | size = INT_MAX; | ||
1712 | sock = sockfd_lookup_light(fd, &err, &fput_needed); | 1716 | sock = sockfd_lookup_light(fd, &err, &fput_needed); |
1713 | if (!sock) | 1717 | if (!sock) |
1714 | goto out; | 1718 | goto out; |