diff options
author | 2022-09-01 17:28:59 -0700 | |
---|---|---|
committer | 2022-09-02 20:34:31 -0700 | |
commit | 0f95f7d42611882a9a6250923dd493951a94961a (patch) | |
tree | 87ad154a47de0da60b316aa34660459fe0a3a0e2 /net/core | |
parent | bpf: net: Change do_ipv6_getsockopt() to take the sockptr_t argument (diff) | |
download | wireguard-linux-0f95f7d42611882a9a6250923dd493951a94961a.tar.xz wireguard-linux-0f95f7d42611882a9a6250923dd493951a94961a.zip |
bpf: net: Avoid do_ipv6_getsockopt() taking sk lock when called from bpf
Similar to the earlier patch that changes sk_getsockopt() to
use sockopt_{lock,release}_sock() such that it can avoid taking the
lock when called from bpf. This patch also changes do_ipv6_getsockopt()
to use sockopt_{lock,release}_sock() such that bpf_getsockopt(SOL_IPV6)
can reuse do_ipv6_getsockopt().
Although bpf_getsockopt(SOL_IPV6) currently does not support optname
that requires lock_sock(), using sockopt_{lock,release}_sock()
consistently across *_getsockopt() will make future optname addition
harder to miss the sockopt_{lock,release}_sock() usage. eg. when
adding new optname that requires a lock and the new optname is
needed in bpf_getsockopt() also.
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20220902002859.2893064-1-kafai@fb.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/core')
0 files changed, 0 insertions, 0 deletions