]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
bpf: net: Change do_ip_setsockopt() to use the sockopt's lock_sock() and capable()
authorMartin KaFai Lau <kafai@fb.com>
Wed, 17 Aug 2022 06:17:37 +0000 (23:17 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 19 Aug 2022 00:06:13 +0000 (17:06 -0700)
commit1df055d3c7d91878fe7eaa61c1c228c03d4a92b7
tree5bde29e77ded3bdbfefd8c4da540b17aaac7f899
parentcb388e7ee3a824250a66b854adae9f03b70956f1
bpf: net: Change do_ip_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_ip_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/20220817061737.4176402-1-kafai@fb.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
net/ipv4/ip_sockglue.c