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 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,  	if (len > INT_MAX)  		len = INT_MAX; +	if (unlikely(!access_ok(VERIFY_READ, buff, len))) +		return -EFAULT;  	sock = sockfd_lookup_light(fd, &err, &fput_needed);  	if (!sock)  		goto out; @@ -1708,6 +1710,8 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size,  	if (size > INT_MAX)  		size = INT_MAX; +	if (unlikely(!access_ok(VERIFY_WRITE, ubuf, size))) +		return -EFAULT;  	sock = sockfd_lookup_light(fd, &err, &fput_needed);  	if (!sock)  		goto out;  | 
