History

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

Al Viro committed 11 years ago

Commit 4de930e1 parent 91edd091 file · +4 −0Browse files

Unified · Split

net/socket.c+4−0
@@ -1702,6 +1702,8 @@ SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len, · 1701 unmodified lines
1702 1702
1703 if (len > INT_MAX)1703 if (len > INT_MAX)
1704 len = INT_MAX;1704 len = INT_MAX;
1705 if (unlikely(!access_ok(VERIFY_READ, buff, len)))
1706 return -EFAULT;
1705 sock = sockfd_lookup_light(fd, &err, &fput_needed);1707 sock = sockfd_lookup_light(fd, &err, &fput_needed);
1706 if (!sock)1708 if (!sock)
1707 goto out;1709 goto out;
@@ -1760,6 +1762,8 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size, · 52 unmodified lines
1760 1762
1761 if (size > INT_MAX)1763 if (size > INT_MAX)
1762 size = INT_MAX;1764 size = INT_MAX;
1765 if (unlikely(!access_ok(VERIFY_WRITE, ubuf, size)))
1766 return -EFAULT;
1763 sock = sockfd_lookup_light(fd, &err, &fput_needed);1767 sock = sockfd_lookup_light(fd, &err, &fput_needed);
1764 if (!sock)1768 if (!sock)
1765 goto out;1769 goto out;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t