Yonghong Song
e7260c8fb0
bpf: fix selftests/bpf test_kmod.sh failure when CONFIG_BPF_JIT_ALWAYS_ON=y
...
[ Upstream commit 09584b406742413ac4c8d7e030374d4daa045b69 ]
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 290af86629b2 (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: 290af86629b2 (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:48:56 +02:00
..
2015-10-14 22:23:17 +08:00
2014-10-09 11:35:48 +03:00
2016-05-04 14:48:41 -07:00
2014-09-28 11:08:01 +02:00
2018-03-03 10:19:42 +01:00
2015-08-31 19:29:05 +02:00
2014-06-04 16:54:18 -07:00
2015-09-10 13:29:01 -07:00
2014-08-06 18:01:24 -07:00
2012-10-08 13:50:18 +10:30
2013-04-29 18:28:19 -07:00
2017-12-16 10:33:48 +01:00
2017-11-02 09:40:49 +01:00
2015-07-27 14:06:24 +02:00
2015-07-27 14:06:24 +02:00
2014-12-13 12:42:51 -08:00
2012-09-10 11:13:16 -07:00
2015-09-10 13:29:01 -07:00
2014-12-22 16:43:06 +00:00
2015-11-23 09:44:58 +01:00
2015-05-28 11:31:52 +09:30
2013-06-19 17:54:06 +02:00
2013-03-22 16:41:20 -07:00
2015-01-29 11:57:38 -08:00
2014-04-03 16:21:12 -07:00
2017-06-29 12:48:51 +02:00
2014-03-20 10:11:35 -04:00
2015-05-27 15:22:15 +02:00
2012-07-30 17:25:22 -07:00
2015-06-18 17:00:23 -10:00
2014-05-16 14:26:52 -04:00
2014-06-25 16:04:00 -07:00
2015-05-26 15:26:43 +02:00
2015-05-30 22:42:24 -07:00
2015-06-11 15:08:32 +02:00
2013-06-26 12:10:56 +02:00
2014-06-04 16:53:53 -07:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2015-07-17 16:39:54 -07:00
2015-10-05 04:49:54 +01:00
2017-10-27 10:23:17 +02:00
2015-11-09 15:11:24 -08:00
2016-06-07 18:14:37 -07:00
2016-02-25 12:01:23 -08:00
2017-12-16 10:33:54 +01:00
2015-02-12 18:54:15 -08:00
2013-08-14 23:24:01 +02:00
2015-10-23 17:55:10 +09:00
2014-04-30 19:49:37 +01:00
2015-04-17 09:03:54 -04:00
2014-01-21 23:17:20 -08:00
2014-09-08 09:51:30 +09:00
2012-10-06 03:04:57 +09:00
2015-02-13 21:21:35 -08:00
2017-12-16 10:33:54 +01:00
2014-08-06 18:01:25 -07:00
2015-11-06 17:50:42 -08:00
2015-11-06 17:50:42 -08:00
2018-04-24 09:32:04 +02:00
2015-11-06 17:50:42 -08:00
2013-04-29 18:28:19 -07:00
2014-05-05 09:09:14 +02:00
2015-02-12 18:54:15 -08:00
2014-04-07 16:36:11 -07:00
2015-11-05 16:34:48 -08:00
2018-03-28 18:40:14 +02:00
2016-09-24 10:07:43 +02:00
2015-11-06 17:50:42 -08:00
2015-11-06 17:50:42 -08:00
2016-03-03 15:07:24 -08:00
2018-02-25 11:03:52 +01:00
2015-11-05 19:34:48 -08:00
2014-11-11 09:31:52 -06:00
2014-08-08 15:57:25 -07:00
2016-02-25 12:01:16 -08:00
2015-02-12 18:54:15 -08:00
2018-05-02 07:53:42 -07:00
2016-10-28 03:01:31 -04:00
2015-03-31 09:45:50 -06:00
2016-02-17 12:31:04 -08:00
2015-06-16 14:12:35 -04:00
2015-11-06 17:50:42 -08:00
2014-10-03 06:09:30 +02:00
2015-08-12 11:59:04 +02:00
2015-04-15 16:35:25 -07:00
2018-04-24 09:32:04 +02:00
2015-02-12 18:54:15 -08:00
2012-07-30 17:25:22 -07:00
2012-07-30 17:25:16 -07:00
2014-06-25 17:45:43 -07:00
2015-03-31 14:07:24 -04:00
2015-10-03 16:40:51 +01:00
2013-04-09 14:13:05 -04:00
2012-07-30 17:25:22 -07:00
2012-12-14 10:32:52 +11:00
2018-02-25 11:03:40 +01:00
2015-10-08 05:26:36 -07:00
2014-01-23 16:36:55 -08:00
2015-09-08 14:35:59 -07:00
2015-05-29 07:39:34 +10:00
2015-11-06 17:50:42 -08:00
2013-11-13 12:09:11 +09:00
2014-09-24 13:31:50 -04:00
2015-02-12 18:54:16 -08:00
2012-07-30 17:25:22 -07:00
2015-11-23 09:44:58 +01:00
2016-02-25 12:01:23 -08:00
2015-10-08 05:26:38 -07:00
2014-01-23 16:37:03 -08:00
2015-05-28 11:32:04 +09:30
2014-01-21 23:17:20 -08:00
2015-12-18 23:44:18 -05:00
2015-08-17 08:12:51 -06:00
2015-03-04 23:40:19 -05:00
2015-08-24 14:28:01 -06:00
2015-03-23 22:12:08 -04:00
2015-09-08 15:35:28 -07:00
2014-04-07 16:36:14 -07:00
2015-06-25 17:00:40 -07:00
2015-02-12 18:54:16 -08:00
2016-02-25 12:01:21 -08:00
2016-10-28 03:01:30 -04:00
2015-08-31 12:36:10 -07:00
2015-06-22 15:52:04 -07:00
2017-07-05 14:37:20 +02:00
2014-04-03 16:21:06 -07:00
2018-05-30 07:48:56 +02:00
2017-11-15 17:13:13 +01:00
2015-11-05 19:34:48 -08:00
2014-01-23 16:36:57 -08:00
2015-11-06 17:50:42 -08:00
2015-08-17 14:33:47 -07:00
2015-08-03 11:51:12 +02:00
2015-08-05 09:53:40 +02:00
2017-06-14 13:16:27 +02:00
2015-06-25 17:00:40 -07:00
2015-09-10 13:29:01 -07:00
2016-05-11 11:21:26 +02:00
2014-10-14 02:18:14 +02:00
2015-04-22 17:06:49 +02:00
2016-03-03 15:07:09 -08:00
2013-04-30 17:04:09 -07:00
2013-04-29 18:28:42 -07:00
2015-11-06 17:50:42 -08:00