]> git.hungrycats.org Git - linux/commit
selftests/bpf: Add retval test for bool and errno LSM cgroup hooks
authorXu Kuohai <xukuohai@huawei.com>
Wed, 10 Jun 2026 20:17:24 +0000 (20:17 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 13 Jun 2026 03:33:16 +0000 (20:33 -0700)
commitcec8423776176eb73429443ecb859789af9602e5
treee7bca3199eab2954238753d23aa47ab02efd07f5
parent4c71303c837449158815c521fcee4ec3b8721dbd
selftests/bpf: Add retval test for bool and errno LSM cgroup hooks

Add test to check the return value when a BPF program exits with 0 for
a boolean and an errno LSM hook.

For each hook, two BPF programs are attached. The first program returns
0 without calling bpf_set_retval() to exercise the return value translation
logic, while the second program reads the retval via bpf_get_retval().

Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Link: https://lore.kernel.org/r/20260610201724.733943-3-xukuohai@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/lsm_cgroup.c
tools/testing/selftests/bpf/progs/lsm_cgroup.c