mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
selftests/bpf: Remove usage of lsm/file_alloc_security in selftest
file_alloc_security hook is disabled. Use other LSM hooks in selftests instead. Signed-off-by: Amery Hung <ameryhung@gmail.com> Link: https://lore.kernel.org/r/20251126202927.2584874-2-ameryhung@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
committed by
Alexei Starovoitov
parent
b4bf1d23dc
commit
a3a60cc120
@@ -139,7 +139,7 @@ static void test_lsm_tailcall(void)
|
||||
if (CHECK_FAIL(!err))
|
||||
goto close_prog;
|
||||
|
||||
prog_fd = bpf_program__fd(skel->progs.lsm_file_alloc_security_prog);
|
||||
prog_fd = bpf_program__fd(skel->progs.lsm_kernfs_init_security_prog);
|
||||
if (CHECK_FAIL(prog_fd < 0))
|
||||
goto close_prog;
|
||||
|
||||
|
||||
@@ -20,14 +20,14 @@ int lsm_file_permission_prog(void *ctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
SEC("lsm/file_alloc_security")
|
||||
int lsm_file_alloc_security_prog(void *ctx)
|
||||
SEC("lsm/kernfs_init_security")
|
||||
int lsm_kernfs_init_security_prog(void *ctx)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SEC("lsm/file_alloc_security")
|
||||
int lsm_file_alloc_security_entry(void *ctx)
|
||||
SEC("lsm/kernfs_init_security")
|
||||
int lsm_kernfs_init_security_entry(void *ctx)
|
||||
{
|
||||
bpf_tail_call_static(ctx, &jmp_table, 0);
|
||||
return 0;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <bpf/bpf_helpers.h>
|
||||
#include "bpf_misc.h"
|
||||
|
||||
SEC("lsm/file_alloc_security")
|
||||
SEC("lsm/file_permission")
|
||||
__description("lsm bpf prog with -4095~0 retval. test 1")
|
||||
__success
|
||||
__naked int errno_zero_retval_test1(void *ctx)
|
||||
@@ -15,7 +15,7 @@ __naked int errno_zero_retval_test1(void *ctx)
|
||||
::: __clobber_all);
|
||||
}
|
||||
|
||||
SEC("lsm/file_alloc_security")
|
||||
SEC("lsm/file_permission")
|
||||
__description("lsm bpf prog with -4095~0 retval. test 2")
|
||||
__success
|
||||
__naked int errno_zero_retval_test2(void *ctx)
|
||||
|
||||
Reference in New Issue
Block a user