bpf: net: Change sk_getsockopt() to take the sockptr_t argument
authorMartin KaFai Lau <martin.lau@kernel.org>
Fri, 2 Sep 2022 00:28:02 +0000 (17:28 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 3 Sep 2022 03:34:30 +0000 (20:34 -0700)
commit4ff09db1b79b98b4a2a7511571c640b76cab3beb
tree4bccfceb51e4846c36c378f214a4e08582588448
parentba74a7608dc12fbbd8ea36e660087f08a81ef26a
bpf: net: Change sk_getsockopt() to take the sockptr_t argument

This patch changes sk_getsockopt() to take the sockptr_t argument
such that it can be used by bpf_getsockopt(SOL_SOCKET) in a
latter patch.

security_socket_getpeersec_stream() is not changed.  It stays
with the __user ptr (optval.user and optlen.user) to avoid changes
to other security hooks.  bpf_getsockopt(SOL_SOCKET) also does not
support SO_PEERSEC.

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20220902002802.2888419-1-kafai@fb.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/filter.h
include/linux/sockptr.h
net/core/filter.c
net/core/sock.c