]> git.baikalelectronics.ru Git - kernel.git/commit
net: improve the user pointer check in init_user_sockptr
authorChristoph Hellwig <hch@lst.de>
Tue, 28 Jul 2020 16:38:36 +0000 (18:38 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Jul 2020 20:43:40 +0000 (13:43 -0700)
commitaac6d22d4167727c1107a0b7a856eedb2db30f76
tree050f16554295c22db098bb4e81021e21d2718c5f
parent57eecbd7b9b7def65ad2bb33cbf0ca0a1a39dcb9
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: 073369af28ce ("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>
include/linux/sockptr.h
net/ipv4/bpfilter/sockopt.c
net/socket.c