diff options
Diffstat (limited to 'net/socket.c')
-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, | |||
1651 | struct iovec iov; | 1651 | struct iovec iov; |
1652 | int fput_needed; | 1652 | int fput_needed; |
1653 | 1653 | ||
1654 | if (len > INT_MAX) | ||
1655 | len = INT_MAX; | ||
1654 | sock = sockfd_lookup_light(fd, &err, &fput_needed); | 1656 | sock = sockfd_lookup_light(fd, &err, &fput_needed); |
1655 | if (!sock) | 1657 | if (!sock) |
1656 | goto out; | 1658 | goto out; |
@@ -1708,6 +1710,8 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size, | |||
1708 | int err, err2; | 1710 | int err, err2; |
1709 | int fput_needed; | 1711 | int fput_needed; |
1710 | 1712 | ||
1713 | if (size > INT_MAX) | ||
1714 | size = INT_MAX; | ||
1711 | sock = sockfd_lookup_light(fd, &err, &fput_needed); | 1715 | sock = sockfd_lookup_light(fd, &err, &fput_needed); |
1712 | if (!sock) | 1716 | if (!sock) |
1713 | goto out; | 1717 | goto out; |