Skip to content

Commit 960764b

Browse files
ameryhungKernel Patches Daemon
authored andcommitted
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 <[email protected]>
1 parent 1630970 commit 960764b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

tools/testing/selftests/bpf/prog_tests/test_lsm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static void test_lsm_tailcall(void)
139139
if (CHECK_FAIL(!err))
140140
goto close_prog;
141141

142-
prog_fd = bpf_program__fd(skel->progs.lsm_file_alloc_security_prog);
142+
prog_fd = bpf_program__fd(skel->progs.lsm_kernfs_init_security_prog);
143143
if (CHECK_FAIL(prog_fd < 0))
144144
goto close_prog;
145145

tools/testing/selftests/bpf/progs/lsm_tailcall.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ int lsm_file_permission_prog(void *ctx)
2020
return 0;
2121
}
2222

23-
SEC("lsm/file_alloc_security")
24-
int lsm_file_alloc_security_prog(void *ctx)
23+
SEC("lsm/kernfs_init_security")
24+
int lsm_kernfs_init_security_prog(void *ctx)
2525
{
2626
return 0;
2727
}
2828

29-
SEC("lsm/file_alloc_security")
30-
int lsm_file_alloc_security_entry(void *ctx)
29+
SEC("lsm/kernfs_init_security")
30+
int lsm_kernfs_init_security_entry(void *ctx)
3131
{
3232
bpf_tail_call_static(ctx, &jmp_table, 0);
3333
return 0;

tools/testing/selftests/bpf/progs/verifier_lsm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <bpf/bpf_helpers.h>
55
#include "bpf_misc.h"
66

7-
SEC("lsm/file_alloc_security")
7+
SEC("lsm/file_permission")
88
__description("lsm bpf prog with -4095~0 retval. test 1")
99
__success
1010
__naked int errno_zero_retval_test1(void *ctx)
@@ -15,7 +15,7 @@ __naked int errno_zero_retval_test1(void *ctx)
1515
::: __clobber_all);
1616
}
1717

18-
SEC("lsm/file_alloc_security")
18+
SEC("lsm/file_permission")
1919
__description("lsm bpf prog with -4095~0 retval. test 2")
2020
__success
2121
__naked int errno_zero_retval_test2(void *ctx)

0 commit comments

Comments
 (0)