projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
91edd09
)
net: validate the range we feed to iov_iter_init() in sys_sendto/sys_recvfrom
author
Al Viro
<
[email protected]
>
Fri, 20 Mar 2015 17:41:43 +0000
(17:41 +0000)
committer
David S. Miller
<
[email protected]
>
Fri, 20 Mar 2015 20:38:06 +0000
(16:38 -0400)
Cc:
[email protected]
# v3.19
Signed-off-by: Al Viro <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/socket.c
patch
|
blob
|
history
diff --git
a/net/socket.c
b/net/socket.c
index bbedbfcb42c2505fceb57fa058f262d90e1670ed..245330ca0015c2fd2548ead861d379714151c901 100644
(file)
--- a/
net/socket.c
+++ b/
net/socket.c
@@
-1702,6
+1702,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;
@@
-1760,6
+1762,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;