aboutsummaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/socket.c b/net/socket.c
index 95d3085cb477..3e776776f42c 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1650,6 +1650,8 @@ SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len,
1650 1650
1651 if (len > INT_MAX) 1651 if (len > INT_MAX)
1652 len = INT_MAX; 1652 len = INT_MAX;
1653 if (unlikely(!access_ok(VERIFY_READ, buff, len)))
1654 return -EFAULT;
1653 sock = sockfd_lookup_light(fd, &err, &fput_needed); 1655 sock = sockfd_lookup_light(fd, &err, &fput_needed);
1654 if (!sock) 1656 if (!sock)
1655 goto out; 1657 goto out;
@@ -1708,6 +1710,8 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size,
1708 1710
1709 if (size > INT_MAX) 1711 if (size > INT_MAX)
1710 size = INT_MAX; 1712 size = INT_MAX;
1713 if (unlikely(!access_ok(VERIFY_WRITE, ubuf, size)))
1714 return -EFAULT;
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;