Commit e02f6bb
selftests/bpf: Skip callback tests if jit is disabled in test_verifier
If CONFIG_BPF_JIT_ALWAYS_ON is not set and bpf_jit_enable is 0, there
exist 6 failed tests.
[root@linux bpf]# echo 0 > /proc/sys/net/core/bpf_jit_enable
[root@linux bpf]# echo 0 > /proc/sys/kernel/unprivileged_bpf_disabled
[root@linux bpf]# ./test_verifier | grep FAIL
torvalds#106/p inline simple bpf_loop call FAIL
torvalds#107/p don't inline bpf_loop call, flags non-zero FAIL
torvalds#108/p don't inline bpf_loop call, callback non-constant FAIL
torvalds#109/p bpf_loop_inline and a dead func FAIL
torvalds#110/p bpf_loop_inline stack locations for loop vars FAIL
torvalds#111/p inline bpf_loop call in a big program FAIL
Summary: 768 PASSED, 15 SKIPPED, 6 FAILED
The test log shows that callbacks are not allowed in non-JITed programs,
interpreter doesn't support them yet, thus these tests should be skipped
if jit is disabled, just handle this case in do_test_single().
With this patch:
[root@linux bpf]# echo 0 > /proc/sys/net/core/bpf_jit_enable
[root@linux bpf]# echo 0 > /proc/sys/kernel/unprivileged_bpf_disabled
[root@linux bpf]# ./test_verifier | grep FAIL
Summary: 768 PASSED, 21 SKIPPED, 0 FAILED
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Acked-by: Hou Tao <houtao1@huawei.com>
Acked-by: Song Liu <song@kernel.org>1 parent 627170b commit e02f6bb
1 file changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
1622 | 1623 | | |
1623 | 1624 | | |
1624 | 1625 | | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
1625 | 1636 | | |
1626 | 1637 | | |
1627 | 1638 | | |
| |||
1844 | 1855 | | |
1845 | 1856 | | |
1846 | 1857 | | |
| 1858 | + | |
| 1859 | + | |
1847 | 1860 | | |
1848 | 1861 | | |
1849 | 1862 | | |
| |||
0 commit comments