mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 22:21:21 +00:00
net: improve the user pointer check in init_user_sockptr
Make sure not just the pointer itself but the whole range lies in
the user address space. For that pass the length and then use
the access_ok helper to do the check.
Fixes: 6d04fe15f7
("net: optimize the sockptr_t for unified kernel/user address spaces")
Reported-by: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d3c4815151
commit
a31edb2059
3 changed files with 8 additions and 14 deletions
|
@ -2105,7 +2105,7 @@ int __sys_setsockopt(int fd, int level, int optname, char __user *user_optval,
|
|||
if (optlen < 0)
|
||||
return -EINVAL;
|
||||
|
||||
err = init_user_sockptr(&optval, user_optval);
|
||||
err = init_user_sockptr(&optval, user_optval, optlen);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue