linux-brain/tools/testing/selftests
Daniel Borkmann a0f66ddf05 bpf, selftests: Adjust few selftest outcomes wrt unreachable code
commit 973377ffe8148180b2651825b92ae91988141b05 upstream

In almost all cases from test_verifier that have been changed in here, we've
had an unreachable path with a load from a register which has an invalid
address on purpose. This was basically to make sure that we never walk this
path and to have the verifier complain if it would otherwise. Change it to
match on the right error for unprivileged given we now test these paths
under speculative execution.

There's one case where we match on exact # of insns_processed. Due to the
extra path, this will of course mismatch on unprivileged. Thus, restrict the
test->insn_processed check to privileged-only.

In one other case, we result in a 'pointer comparison prohibited' error. This
is similarly due to verifying an 'invalid' branch where we end up with a value
pointer on one side of the comparison.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
[OP: ignore changes to tests that do not exist in 5.4]
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-08 09:04:09 +02:00
..
android treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
arm64 selftests, arm64: add kernel headers path for tags_test 2019-09-17 12:11:50 +01:00
bpf bpf, selftests: Adjust few selftest outcomes wrt unreachable code 2021-08-08 09:04:09 +02:00
breakpoints treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
capabilities selftests: Add test plan API to kselftest.h and adjust callers 2019-04-25 13:15:46 -06:00
cgroup tools/testing/selftests/cgroup/cgroup_util.c: cg_read_strcmp: fix null pointer dereference 2020-08-26 10:40:57 +02:00
cpu-hotplug
cpufreq
drivers selftests: mlxsw: qos_mc_aware: Specify arping timeout as an integer 2020-06-07 13:18:52 +02:00
efivarfs treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
exec treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166 2019-05-30 11:26:39 -07:00
filesystems
firmware selftests: firmware: Fix it to do root uid check and skip 2020-01-17 19:49:04 +01:00
ftrace Revert "selftests/ftrace: check for do_sys_openat2 in user-memory test" 2020-12-21 13:27:06 +01:00
futex treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
gpio selftests/gpio: Fix build when source tree is read only 2021-06-03 08:59:03 +02:00
ia64 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
intel_pstate
ipc selftests/ipc: Fix test failure seen after initial test run 2020-05-10 10:31:23 +02:00
ir media: selftests: ir: fix ir_loopback test failure 2019-08-14 05:06:25 -03:00
kcmp treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
kexec sefltest/ima: support appended signatures (modsig) 2019-08-29 12:45:30 -04:00
kmod selftests: kmod: fix handling test numbers above 9 2020-04-29 16:33:00 +02:00
kselftest tweewide: Fix most Shebang lines 2021-05-22 11:38:30 +02:00
kvm KVM: selftests: Fix kvm_check_cap() assertion 2021-06-30 08:47:49 -04:00
lib treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
livepatch selftests: Install settings files to fix TIMEOUT failures 2020-03-05 16:43:47 +01:00
locking
media_tests media: selftests: media_dev_allocator api test 2019-04-22 11:23:14 -04:00
membarrier selftests, sched/membarrier: Add multi-threaded test 2019-09-25 17:42:31 +02:00
memfd
memory-hotplug
mount
mqueue
net selftests: icmp_redirect: IPv6 PMTU info should be cleared after redirect 2021-07-28 13:30:53 +02:00
netfilter selftests: netfilter: use randomized netns names 2020-01-12 12:21:15 +01:00
networking/timestamping selftests: txtimestamp: fix compilation issue 2021-02-17 10:35:17 +01:00
nsfs treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
ntb NTB: ntb_test: Fix bug when counting remote files 2020-06-24 17:50:41 +02:00
pidfd selftests: pidfd: fix compilation errors due to wait.h 2020-11-18 19:20:22 +01:00
powerpc selftests/powerpc: Fix "no_handler" EBB selftest 2021-07-20 16:10:44 +02:00
prctl
proc selftests: proc: fix warning: _GNU_SOURCE redefined 2020-11-18 19:20:25 +01:00
pstore treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 472 2019-06-19 17:09:11 +02:00
ptp ptp: Extend the test program to check the external time stamp flags. 2019-11-15 12:48:33 -08:00
ptrace selftests/ptrace: add test cases for dead-locks 2020-10-01 13:17:48 +02:00
rcutorture rcutorture: Test TREE03 with the threadirqs kernel boot parameter 2019-08-01 14:30:22 -07:00
rseq selftests/rseq: Fix out-of-tree compilation 2020-03-21 08:11:49 +01:00
rtc selftests: Install settings files to fix TIMEOUT failures 2020-03-05 16:43:47 +01:00
safesetid selftests: safesetid: Fix Makefile to set correct test program 2020-01-12 12:21:20 +01:00
seccomp selftests/seccomp: Update kernel config 2020-12-30 11:51:16 +01:00
sigaltstack treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
size kselftest: Minimise dependency of get_size on C library interfaces 2020-02-24 08:36:28 +01:00
sparc64
splice
static_keys treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
sync selftests: Add test plan API to kselftest.h and adjust callers 2019-04-25 13:15:46 -06:00
sysctl treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
tc-testing tc-testing: fix list handling 2021-07-14 16:53:31 +02:00
timers selftests: timers: rtcpie: skip test if default RTC device does not exist 2021-07-20 16:10:43 +02:00
tmpfs treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
tpm2 selftests: tpm: Use /bin/sh instead of /bin/bash 2020-07-09 09:37:51 +02:00
uevent
user treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
vDSO treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 180 2019-05-30 11:29:20 -07:00
vm selftest: fix build error in tools/testing/selftests/vm/userfaultfd.c 2021-07-31 08:19:37 +02:00
watchdog selftests: watchdog: Add command line option to show watchdog_info 2019-10-02 13:44:43 -06:00
x86 selftests/vm/pkeys: fix alloc_random_pkey() to make it really, really random 2021-07-14 16:53:47 +02:00
zram docs: blockdev: add it to the admin-guide 2019-07-15 11:03:01 -03:00
.gitignore selftests/tpm2: Add log and *.pyc to .gitignore 2019-09-25 02:43:51 +03:00
Makefile kselftest: Fix NULL INSTALL_PATH for TARGETS runlist 2019-12-13 08:43:31 +01:00
gen_kselftest_tar.sh selftests: gen_kselftest_tar.sh: Do not clobber kselftest/ 2020-01-26 10:01:06 +01:00
kselftest.h kselftest: save-and-restore errno to allow for %m formatting 2019-07-30 15:46:48 -06:00
kselftest_harness.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 481 2019-06-19 17:09:51 +02:00
kselftest_install.sh selftests: gen_kselftest_tar.sh: Do not clobber kselftest/ 2020-01-26 10:01:06 +01:00
kselftest_module.h
kselftest_module.sh
lib.mk selftests: Set CC to clang in lib.mk if LLVM is set 2021-05-19 10:08:22 +02:00