]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: Add tests for bpf_cgroup_read_xattr
authorSong Liu <song@kernel.org>
Mon, 23 Jun 2025 06:38:54 +0000 (23:38 -0700)
committerChristian Brauner <brauner@kernel.org>
Wed, 2 Jul 2025 12:18:20 +0000 (14:18 +0200)
commit21eebc655b0f8e84fcac2cf5e20e9eb31d17a982
tree656990553ada82d63d6e2b407d1637e893fa12ed
parent5bc9557c9f17c38ed8c9070c1d369d49eabea1a9
selftests/bpf: Add tests for bpf_cgroup_read_xattr

Add tests for different scenarios with bpf_cgroup_read_xattr:
1. Read cgroup xattr from bpf_cgroup_from_id;
2. Read cgroup xattr from bpf_cgroup_ancestor;
3. Read cgroup xattr from css_iter;
4. Use bpf_cgroup_read_xattr in LSM hook security_socket_connect.
5. Use bpf_cgroup_read_xattr in cgroup program.

Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/20250623063854.1896364-5-song@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
tools/testing/selftests/bpf/bpf_experimental.h
tools/testing/selftests/bpf/prog_tests/cgroup_xattr.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/cgroup_read_xattr.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/read_cgroupfs_xattr.c [new file with mode: 0644]