OpenCloudOS-Kernel/tools/testing/selftests
Gianluca Borello db1ac4964f bpf: introduce ARG_PTR_TO_MEM_OR_NULL
With the current ARG_PTR_TO_MEM/ARG_PTR_TO_UNINIT_MEM semantics, an helper
argument can be NULL when the next argument type is ARG_CONST_SIZE_OR_ZERO
and the verifier can prove the value of this next argument is 0. However,
most helpers are just interested in handling <!NULL, 0>, so forcing them to
deal with <NULL, 0> makes the implementation of those helpers more
complicated for no apparent benefits, requiring them to explicitly handle
those corner cases with checks that bpf programs could start relying upon,
preventing the possibility of removing them later.

Solve this by making ARG_PTR_TO_MEM/ARG_PTR_TO_UNINIT_MEM never accept NULL
even when ARG_CONST_SIZE_OR_ZERO is set, and introduce a new argument type
ARG_PTR_TO_MEM_OR_NULL to explicitly deal with the NULL case.

Currently, the only helper that needs this is bpf_csum_diff_proto(), so
change arg1 and arg3 to this new type as well.

Also add a new battery of tests that explicitly test the
!ARG_PTR_TO_MEM_OR_NULL combination: all the current ones testing the
various <NULL, 0> variations are focused on bpf_csum_diff, so cover also
other helpers.

Signed-off-by: Gianluca Borello <g.borello@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2017-11-22 21:40:54 +01:00
..
android android/ion: userspace test utility for ion buffer sharing 2017-11-15 08:07:53 -07:00
bpf bpf: introduce ARG_PTR_TO_MEM_OR_NULL 2017-11-22 21:40:54 +01:00
breakpoints selftests: breakpoints: fix compile error on breakpoint_test_arm64 2017-11-15 08:01:43 -07:00
capabilities License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cpu-hotplug selftests: remove obsolete kconfig fragment for cpu-hotplug 2017-11-15 08:01:43 -07:00
cpufreq License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
drivers/gpu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
efivarfs License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
exec selftests/exec: include cwd in long path calculation 2017-11-15 08:01:42 -07:00
filesystems License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
firmware selftests: firmware: skip unsupported custom firmware fallback tests 2017-11-15 08:27:57 -07:00
ftrace selftests/ftrace: Introduce exit_pass and exit_fail 2017-11-15 08:07:53 -07:00
futex License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gpio License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ia64 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
intel_pstate License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ipc License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kcmp License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kmod test_kmod: fix description for -s -and -c parameters 2017-08-18 15:32:01 -07:00
lib License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
locking License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
media_tests License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
membarrier License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
memfd selftests: memfd_test.c: fix compilation warning. 2017-11-15 08:07:53 -07:00
memory-hotplug selftests: add missing test result status in memory-hotplug test 2017-11-15 08:01:43 -07:00
mount License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mqueue License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
networking/timestamping License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nsfs License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ntb ntb: ntb_test: ensure the link is up before trying to configure the mws 2017-08-01 15:18:59 -04:00
powerpc powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
prctl License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pstore License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ptp License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ptrace License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rcutorture Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-11-13 12:38:26 -08:00
seccomp selftests: seccomp: update .gitignore with newly added tests 2017-11-15 08:01:42 -07:00
sigaltstack License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
size kselftest: convert get_size to use stricter TAP13 format 2017-06-14 18:23:27 -06:00
splice License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
static_keys License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sync License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sysctl test_sysctl: fix sysctl.sh by making it executable 2017-08-07 15:13:36 -06:00
tc-testing Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
timers selftests: timers: Update .gitignore with newly added tests 2017-11-15 08:01:42 -07:00
user License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vDSO selftests: vdso_test: support ARM64 targets 2017-11-15 08:01:43 -07:00
vm Merge branch 'akpm' (patches from Andrew) 2017-11-17 16:56:17 -08:00
watchdog License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
x86 selftests/x86: Add tests for the STR and SLDT instructions 2017-11-08 11:16:25 +01:00
zram License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
.gitignore selftests: add gpio generated files to .gitignore 2017-04-25 09:49:38 -06:00
Makefile android/ion: userspace test utility for ion buffer sharing 2017-11-15 08:07:53 -07:00
gen_kselftest_tar.sh selftests: Add tool to generate kselftest tar archive 2015-03-24 08:43:19 -06:00
kselftest.h selftests: kselftest framework: change skip exit code to 0 2017-08-25 10:02:00 -06:00
kselftest_harness.h selftests: Enhance kselftest_harness.h to print which assert failed 2017-09-05 19:21:33 -06:00
kselftest_install.sh selftests: Add kselftest install tool 2015-03-24 08:43:05 -06:00
lib.mk selftests: lib.mk: print individual test results to console by default 2017-10-31 13:24:00 -06:00