Skip to content

Commit 9c966ac

Browse files
puranjaymohanKernel Patches Daemon
authored andcommitted
selftests: bpf: fix tests with raw_tp calling kfuncs
As the previous commit allowed raw_tp programs to call kfuncs, so of the selftests that were expected to fail will now succeed. Signed-off-by: Puranjay Mohan <puranjay@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev>
1 parent f38c36f commit 9c966ac

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,7 @@ int xdp_invalid_data_slice2(struct xdp_md *xdp)
14651465
}
14661466

14671467
/* Only supported prog type can create skb-type dynptrs */
1468-
SEC("?raw_tp")
1468+
SEC("?xdp")
14691469
__failure __msg("calling kernel function bpf_dynptr_from_skb is not allowed")
14701470
int skb_invalid_ctx(void *ctx)
14711471
{

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static void task_kfunc_load_test(void)
3232
}
3333

3434
SEC("raw_tp")
35-
__failure __msg("calling kernel function")
35+
__success
3636
int BPF_PROG(task_kfunc_raw_tp)
3737
{
3838
task_kfunc_load_test();
@@ -86,7 +86,7 @@ static void cgrp_kfunc_load_test(void)
8686
}
8787

8888
SEC("raw_tp")
89-
__failure __msg("calling kernel function")
89+
__success
9090
int BPF_PROG(cgrp_kfunc_raw_tp)
9191
{
9292
cgrp_kfunc_load_test();
@@ -138,7 +138,7 @@ static void cpumask_kfunc_load_test(void)
138138
}
139139

140140
SEC("raw_tp")
141-
__failure __msg("calling kernel function")
141+
__success
142142
int BPF_PROG(cpumask_kfunc_raw_tp)
143143
{
144144
cpumask_kfunc_load_test();

0 commit comments

Comments
 (0)