]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Test bpf_{get,set}_retval behavior with cgroup/sockopt
authorYiFei Zhu <zhuyifei@google.com>
Thu, 16 Dec 2021 02:04:28 +0000 (02:04 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 19 Jan 2022 20:51:30 +0000 (12:51 -0800)
commit9b7505f1dfa950f7ead706f87b61ad20f79710b3
tree24a23960153e626bd6d19214b1a52794befde5a8
parentde9730e9a4055a57e42cb74ee9e0dcf69784276c
selftests/bpf: Test bpf_{get,set}_retval behavior with cgroup/sockopt

The tests checks how different ways of interacting with the helpers
(getting retval, setting EUNATCH, EISCONN, and legacy reject
returning 0 without setting retval), produce different results in
both the setsockopt syscall and the retval returned by the helper.
A few more tests verify the interaction between the retval of the
helper and the retval in getsockopt context.

Signed-off-by: YiFei Zhu <zhuyifei@google.com>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/r/43ec60d679ae3f4f6fd2460559c28b63cb93cd12.1639619851.git.zhuyifei@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/cgroup_getset_retval.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/cgroup_getset_retval_getsockopt.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/cgroup_getset_retval_setsockopt.c [new file with mode: 0644]