Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 799595d0 authored by Al Viro's avatar Al Viro Committed by Gerrit - the friendly Code Review server
Browse files

net: validate the range we feed to iov_iter_init() in sys_sendto/sys_recvfrom



Change-Id: I4bbd1bd2b661bc21aa0fdcc436b09b3bd23803be
Cc: stable@vger.kernel.org # v3.19
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Git-commit: 4de930efc23b92ddf88ce91c405ee645fe6e27ea
Git-repo: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarRavi Kumar Siddojigari <rsiddoji@codeaurora.org>
parent 8623f69c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1824,6 +1824,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;
@@ -1883,6 +1885,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;