Yonghong Song
09584b4067
bpf: fix selftests/bpf test_kmod.sh failure when CONFIG_BPF_JIT_ALWAYS_ON=y
With CONFIG_BPF_JIT_ALWAYS_ON is defined in the config file,
tools/testing/selftests/bpf/test_kmod.sh failed like below:
[root@localhost bpf]# ./test_kmod.sh
sysctl: setting key "net.core.bpf_jit_enable": Invalid argument
[ JIT enabled:0 hardened:0 ]
[ 132.175681] test_bpf: #297 BPF_MAXINSNS: Jump, gap, jump, ... FAIL to prog_create err=-524 len=4096
[ 132.458834] test_bpf: Summary: 348 PASSED, 1 FAILED, [340/340 JIT'ed]
[ JIT enabled:1 hardened:0 ]
[ 133.456025] test_bpf: #297 BPF_MAXINSNS: Jump, gap, jump, ... FAIL to prog_create err=-524 len=4096
[ 133.730935] test_bpf: Summary: 348 PASSED, 1 FAILED, [340/340 JIT'ed]
[ JIT enabled:1 hardened:1 ]
[ 134.769730] test_bpf: #297 BPF_MAXINSNS: Jump, gap, jump, ... FAIL to prog_create err=-524 len=4096
[ 135.050864] test_bpf: Summary: 348 PASSED, 1 FAILED, [340/340 JIT'ed]
[ JIT enabled:1 hardened:2 ]
[ 136.442882] test_bpf: #297 BPF_MAXINSNS: Jump, gap, jump, ... FAIL to prog_create err=-524 len=4096
[ 136.821810] test_bpf: Summary: 348 PASSED, 1 FAILED, [340/340 JIT'ed]
[root@localhost bpf]#
The test_kmod.sh load/remove test_bpf.ko multiple times with different
settings for sysctl net.core.bpf_jit_{enable,harden}. The failed test #297
of test_bpf.ko is designed such that JIT always fails.
Commit 290af86629 (bpf: introduce BPF_JIT_ALWAYS_ON config)
introduced the following tightening logic:
...
if (!bpf_prog_is_dev_bound(fp->aux)) {
fp = bpf_int_jit_compile(fp);
#ifdef CONFIG_BPF_JIT_ALWAYS_ON
if (!fp->jited) {
*err = -ENOTSUPP;
return fp;
}
#endif
...
With this logic, Test #297 always gets return value -ENOTSUPP
when CONFIG_BPF_JIT_ALWAYS_ON is defined, causing the test failure.
This patch fixed the failure by marking Test #297 as expected failure
when CONFIG_BPF_JIT_ALWAYS_ON is defined.
Fixes: 290af86629 (bpf: introduce BPF_JIT_ALWAYS_ON config)
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-02-05 00:31:57 +01:00
..
2017-12-22 19:39:09 +11:00
2017-12-01 13:09:40 -08:00
2017-12-01 13:09:40 -08:00
2017-12-08 15:13:27 +00:00
2017-12-04 10:52:56 -08:00
2017-12-11 09:58:39 -05:00
2017-11-17 16:10:01 -08:00
2018-01-12 23:03:01 +11:00
2017-12-01 13:09:40 -08:00
2018-01-08 10:08:33 +00:00
2017-11-13 08:25:06 -08:00
2017-11-17 16:10:00 -08:00
2018-01-15 09:35:15 +01:00
2017-11-17 16:10:01 -08:00
2017-11-15 11:56:19 -08:00
2018-01-12 17:33:38 -08:00
2018-01-01 12:40:27 -07:00
2017-11-17 16:10:02 -08:00
2017-11-15 18:21:06 -08:00
2017-11-17 16:10:01 -08:00
2017-11-17 16:10:02 -08:00
2017-11-02 10:04:46 -07:00
2018-01-31 11:32:27 -08:00
2018-01-31 14:31:10 -08:00
2018-01-02 14:56:51 +01:00
2018-02-01 10:00:28 -08:00
2017-12-01 13:09:40 -08:00
2018-01-31 14:31:10 -08:00
2017-12-01 13:09:40 -08:00
2017-12-07 14:00:57 -05:00
2017-11-17 16:10:02 -08:00
2017-12-08 15:13:28 +00:00
2017-11-04 09:26:51 +09:00
2017-12-04 10:52:53 -08:00
2017-11-15 18:21:06 -08:00
2017-11-21 15:57:05 -08:00
2017-11-17 16:10:02 -08:00
2017-12-14 16:00:48 -08:00
2017-12-11 09:58:39 -05:00
2017-12-22 11:09:37 -07:00
2018-01-19 12:31:03 -07:00
2018-01-05 15:24:00 +01:00
2018-02-01 12:20:21 -08:00
2018-01-15 09:35:50 +01:00
2018-02-05 00:31:57 +01:00
2017-11-17 16:10:02 -08:00
2018-01-22 16:55:38 +01:00
2017-11-17 16:10:01 -08:00
2018-01-09 16:33:31 +01:00
2017-11-17 16:10:01 -08:00
2017-11-29 12:09:02 +11:00
2017-12-11 09:58:38 -05:00
2017-11-17 16:10:01 -08:00
2017-12-29 23:13:10 +01:00
2017-12-01 13:09:40 -08:00
2017-12-11 09:35:11 -05:00
2017-12-11 15:03:08 -07:00
2018-02-01 13:36:15 -08:00