Skip to content

Commit e3fa473

Browse files
kkdwivediAlexei Starovoitov
authored andcommitted
selftests/bpf: Fix test_verifier failed test in unprivileged mode
Loading the BTF won't be permitted without privileges, hence only test for privileged mode by setting the prog type. This makes the test_verifier show 0 failures when unprivileged BPF is enabled. Fixes: 41188e9 ("selftest/bpf: Test for use-after-free bug fix in inline_bpf_loop") Signed-off-by: Kumar Kartikeya Dwivedi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent c6f420a commit e3fa473

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/testing/selftests/bpf/verifier/bpf_loop_inline.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@
251251
.expected_insns = { PSEUDO_CALL_INSN() },
252252
.unexpected_insns = { HELPER_CALL_INSN() },
253253
.result = ACCEPT,
254+
.prog_type = BPF_PROG_TYPE_TRACEPOINT,
254255
.func_info = { { 0, MAIN_TYPE }, { 16, CALLBACK_TYPE } },
255256
.func_info_cnt = 2,
256257
BTF_TYPES

0 commit comments

Comments
 (0)