]> www.infradead.org Git - users/dwmw2/linux.git/commit
selftests/bpf: Add tests for bpf_get_dentry_xattr
authorSong Liu <song@kernel.org>
Tue, 6 Aug 2024 23:09:04 +0000 (16:09 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 7 Aug 2024 18:28:04 +0000 (11:28 -0700)
commit8681156c0939a7511c47b9cc462390a83f0e846a
treec2709241d6c34175b999eac6e07886f2f42373c2
parentac13a4261afe81ca423eddd8e6571078fe2a7cea
selftests/bpf: Add tests for bpf_get_dentry_xattr

Add test for bpf_get_dentry_xattr on hook security_inode_getxattr.
Verify that the kfunc can read the xattr. Also test failing getxattr
from user space by returning non-zero from the LSM bpf program.

Acked-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20240806230904.71194-4-song@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/bpf_kfuncs.h
tools/testing/selftests/bpf/prog_tests/fs_kfuncs.c
tools/testing/selftests/bpf/progs/test_get_xattr.c