summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/setget_sockopt.c
diff options
context:
space:
mode:
authorKui-Feng Lee <kuifeng@meta.com>2023-01-25 12:16:07 -0800
committerMartin KaFai Lau <martin.lau@kernel.org>2023-01-25 14:49:11 -0800
commit2ab42c7b871f4e85f21e1a85dfa3f87e4d31221d (patch)
tree9eee2c57ef6a20b60ec195cb9734d3874718f52f /tools/testing/selftests/bpf/prog_tests/setget_sockopt.c
parenta5f6b9d577eba18601c14bba2dbff4a9b76af962 (diff)
downloadlinux-2ab42c7b871f4e85f21e1a85dfa3f87e4d31221d.tar.gz
linux-2ab42c7b871f4e85f21e1a85dfa3f87e4d31221d.tar.bz2
linux-2ab42c7b871f4e85f21e1a85dfa3f87e4d31221d.zip
bpf: Check the protocol of a sock to agree the calls to bpf_setsockopt().
Resolve an issue when calling sol_tcp_sockopt() on a socket with ktls enabled. Prior to this patch, sol_tcp_sockopt() would only allow calls if the function pointer of setsockopt of the socket was set to tcp_setsockopt(). However, any socket with ktls enabled would have its function pointer set to tls_setsockopt(). To resolve this issue, the patch adds a check of the protocol of the linux socket and allows bpf_setsockopt() to be called if ktls is initialized on the linux socket. This ensures that calls to sol_tcp_sockopt() will succeed on sockets with ktls enabled. Signed-off-by: Kui-Feng Lee <kuifeng@meta.com> Link: https://lore.kernel.org/r/20230125201608.908230-2-kuifeng@meta.com Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/setget_sockopt.c')
0 files changed, 0 insertions, 0 deletions