Yonghong Song
ee4bba566d
bpf: fix selftests/bpf test_kmod.sh failure when CONFIG_BPF_JIT_ALWAYS_ON=y
[ Upstream commit 09584b4067 ]
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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-30 07:50:24 +02:00
..
2016-03-17 21:38:27 -07:00
2017-09-02 07:07:54 +02:00
2018-03-03 10:23:23 +01:00
2016-10-07 09:45:43 -07:00
2017-12-14 09:28:12 +01:00
2017-11-02 09:49:14 +01:00
2016-10-07 18:46:30 -07:00
locking/atomic: Implement atomic{,64,_long}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()
2016-06-16 10:48:32 +02:00
2016-10-11 15:06:30 -07:00
2016-03-17 15:09:34 -07:00
2016-07-03 00:57:23 -04:00
2016-03-13 23:55:13 -04:00
2017-06-29 13:00:28 +02:00
2016-09-19 21:44:31 +02:00
2017-07-21 07:42:23 +02:00
2016-08-02 19:35:08 -04:00
2016-11-30 16:32:52 -08:00
2016-02-07 23:17:59 -08:00
2017-10-27 10:38:08 +02:00
2016-10-06 17:13:54 -07:00
2016-08-04 08:50:07 -04:00
2016-02-05 18:10:40 -08:00
2017-12-14 09:28:22 +01:00
2016-06-08 11:04:19 +02:00
2016-02-24 14:57:26 +00:00
2016-02-15 11:18:23 +01:00
2016-05-20 17:58:30 -07:00
2017-12-14 09:28:22 +01:00
2016-06-08 15:01:02 +02:00
2016-01-20 17:09:18 -08:00
2016-08-02 19:35:07 -04:00
2018-03-28 18:39:21 +02:00
2017-04-21 09:31:21 +02:00
2016-10-15 10:03:15 -07:00
2016-10-07 21:38:00 -07:00
2018-02-25 11:05:55 +01:00
2016-07-28 16:07:41 -07:00
2016-05-23 17:04:14 -07:00
2016-09-20 14:26:08 +02:00
2016-02-07 22:18:47 -08:00
2018-05-01 15:13:07 -07:00
2016-10-11 15:06:30 -07:00
2017-06-24 07:11:17 +02:00
2016-03-09 15:43:42 -08:00
2016-11-25 07:12:19 +01:00
2016-10-11 15:06:32 -07:00
2016-04-23 20:13:24 -04:00
2016-10-07 18:46:30 -07:00
2016-05-19 19:12:14 -07:00
2018-02-25 11:05:48 +01:00
2016-05-19 19:12:14 -07:00
2016-08-11 13:52:23 -04:00
2016-12-09 10:41:42 -08:00
2016-10-15 10:03:15 -07:00
2017-10-12 11:51:19 +02:00
2016-07-06 10:51:14 +01:00
2018-03-31 18:11:33 +02:00
2016-09-19 08:19:40 -06:00
2016-02-08 10:15:17 -08:00
2016-04-15 16:53:14 -04:00
2016-11-11 08:12:37 -08:00
2016-04-21 10:47:26 +10:00
2016-03-17 15:09:34 -07:00
2016-10-11 15:06:30 -07:00
2016-08-08 13:02:01 -07:00
2017-07-05 14:40:26 +02:00
2017-04-08 09:30:35 +02:00
2016-02-19 22:54:09 -05:00
2018-05-30 07:50:24 +02:00
2016-09-01 17:52:01 -07:00
2016-01-20 17:09:18 -08:00
2016-11-30 16:32:52 -08:00
2016-03-15 16:55:16 -07:00
2016-08-08 12:52:42 -07:00
2016-02-09 10:27:29 +01:00
2017-06-14 15:06:05 +02:00
2016-05-30 15:26:57 -07:00
2016-02-03 08:28:43 -08:00
2018-02-17 13:21:20 +01:00
2018-02-17 13:21:20 +01:00
2016-09-09 16:08:46 +01:00
2016-05-30 15:26:57 -07:00
2016-05-20 17:58:30 -07:00
2016-09-21 00:22:59 -04:00