bpf: net: Change do_ipv6_setsockopt() to use the sockopt's lock_sock() and capable()
authorMartin KaFai Lau <kafai@fb.com>
Wed, 17 Aug 2022 06:17:44 +0000 (23:17 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 19 Aug 2022 00:06:13 +0000 (17:06 -0700)
commit40cd308ea57cf68ad67f912b98fca570d107cca0
tree56b980d0e4f93d220f37b7a874ec3850b3efc37e
parent1df055d3c7d91878fe7eaa61c1c228c03d4a92b7
bpf: net: Change do_ipv6_setsockopt() to use the sockopt's lock_sock() and capable()

Similar to the earlier patch that avoids sk_setsockopt() from
taking sk lock and doing capable test when called by bpf.  This patch
changes do_ipv6_setsockopt() to use the sockopt_{lock,release}_sock()
and sockopt_[ns_]capable().

Reviewed-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/r/20220817061744.4176893-1-kafai@fb.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
net/ipv6/ipv6_sockglue.c