]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
selftests/bpf: Make sure bpf_{g,s}et_retval is exposed everywhere
authorStanislav Fomichev <sdf@google.com>
Tue, 23 Aug 2022 22:25:55 +0000 (15:25 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 23 Aug 2022 23:08:22 +0000 (16:08 -0700)
commite7215f574079ffb138258e8ebfa3f2bf5a4a1238
tree557007c706143409746cbe43ebcfc9d0a61cbf34
parent2172fb8007eaafbef18563afb6c1ae5a976bf787
selftests/bpf: Make sure bpf_{g,s}et_retval is exposed everywhere

For each hook, have a simple bpf_set_retval(bpf_get_retval) program
and make sure it loads for the hooks we want. The exceptions are
the hooks which don't propagate the error to the callers:

- sockops
- recvmsg
- getpeername
- getsockname
- cg_skb ingress and egress

Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/r/20220823222555.523590-6-sdf@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/cgroup_getset_retval_hooks.h [new file with mode: 0644]
tools/testing/selftests/bpf/prog_tests/cgroup_getset_retval.c
tools/testing/selftests/bpf/progs/cgroup_getset_retval_hooks.c [new file with mode: 0644]