linux_dsm_epyc7002/tools/testing/selftests
Arthur Fabre fbeb1603bf bpf: verifier: MOV64 don't mark dst reg unbounded
When check_alu_op() handles a BPF_MOV64 between two registers,
it calls check_reg_arg(DST_OP) on the dst register, marking it
as unbounded. If the src and dst register are the same, this
marks the src as unbounded, which can lead to unexpected errors
for further checks that rely on bounds info. For example:

	BPF_MOV64_IMM(BPF_REG_2, 0),
	BPF_MOV64_REG(BPF_REG_2, BPF_REG_2),
	BPF_ALU64_REG(BPF_ADD, BPF_REG_1, BPF_REG_2),
	BPF_MOV64_IMM(BPF_REG_0, 0),
	BPF_EXIT_INSN(),

Results in:

	"math between ctx pointer and register with unbounded
	min value is not allowed"

check_alu_op() now uses check_reg_arg(DST_OP_NO_MARK), and MOVs
that need to mark the dst register (MOVIMM, MOV32) do so.

Added a test case for MOV64 dst == src, and dst != src.

Signed-off-by: Arthur Fabre <afabre@cloudflare.com>
Acked-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-07-31 22:09:33 +02:00
..
android selftests: android: ion: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
bpf bpf: verifier: MOV64 don't mark dst reg unbounded 2018-07-31 22:09:33 +02:00
breakpoints selftests: breakpoints: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
capabilities
cgroup kselftest/cgroup: fix a signedness bug 2018-06-07 13:44:30 -06:00
cpu-hotplug selftests: cpu-hotplug: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
cpufreq selftests: cpufreq: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
drivers selftests: mlxsw: Add mlxsw-specific test for mirror to gretap 2018-07-07 20:29:34 +09:00
efivarfs selftests: efivarfs: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
exec selftests: exec: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
filesystems selftests: filesystems: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
firmware selftests: firmware: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
ftrace linux-kselftest-4.18-rc1-2 2018-06-15 17:26:29 +09:00
futex selftests: futex: delete RUN_TESTS and EMIT_TESTS overrides 2018-05-30 15:21:52 -06:00
gpio selftests: gpio: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
ia64
intel_pstate selftests: intel_pstate: notification about privilege required to run intel_pstate testing script 2018-05-30 21:31:31 -06:00
ipc selftests: ipc: return Kselftest Skip code for skipped tests 2018-05-30 15:21:53 -06:00
kcmp
kmod selftests: kmod: return Kselftest Skip code for skipped tests 2018-05-30 15:21:53 -06:00
kvm selftests: kvm: return Kselftest Skip code for skipped tests 2018-05-30 15:29:05 -06:00
lib selftests: lib: fix prime_numbers module search and skip logic 2018-05-30 21:32:55 -06:00
locking selftests: locking: return Kselftest Skip code for skipped tests 2018-05-30 15:29:06 -06:00
media_tests selftests: media_tests: return Kselftest Skip code for skipped tests 2018-05-30 15:29:06 -06:00
membarrier selftests: membarrier: return Kselftest Skip code for skipped tests 2018-05-30 15:29:06 -06:00
memfd selftests: memfd: split regular and hugetlbfs tests 2018-05-30 15:29:06 -06:00
memory-hotplug selftests: memory-hotplug: return Kselftest Skip code for skipped tests 2018-05-30 15:29:06 -06:00
mount selftests: mount: delete RUN_TESTS and EMIT_TESTS overrides 2018-05-30 15:21:52 -06:00
mqueue selftests: mqueue: return Kselftest Skip code for skipped tests 2018-05-30 15:29:06 -06:00
net selftests: forwarding: add tests for TC chain templates 2018-07-23 20:44:13 -07:00
networking/timestamping
nsfs
ntb
powerpc selftests/powerpc: Add perf breakpoint test 2018-06-03 21:16:44 +10:00
prctl
proc tools/testing/selftests/proc: test /proc/*/fd a bit (+ PF_KTHREAD is ABI!) 2018-06-07 17:34:38 -07:00
pstore selftests: pstore: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
ptp
ptrace
rcutorture torture: Make kvm-find-errors.sh find build warnings 2018-05-15 10:32:25 -07:00
rseq rseq/selftests: cleanup: Update comment above rseq_prepare_unload 2018-07-10 22:18:52 +02:00
rtc selftests: rtc: rework rtctest 2018-05-30 15:21:51 -06:00
seccomp seccomp: Add filter flag to opt-out of SSB mitigation 2018-05-05 00:51:44 +02:00
sigaltstack
size
sparc64 selftests: sparc64: Add missing SPDX License Identifiers 2018-06-18 09:29:20 -06:00
splice
static_keys selftests: static_keys: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
sync selftests: sync: add config fragment for testing sync framework 2018-06-18 09:11:10 -06:00
sysctl selftests: sysctl: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
tc-testing tc-tests: initial version of fw filter unit tests 2018-07-18 15:20:37 -07:00
timers selftests: move RTC tests to rtc subfolder 2018-05-30 15:21:51 -06:00
uevent selftests: uevent filtering 2018-05-23 15:24:22 -04:00
user selftests: user: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
vDSO
vm selftests: vm: return Kselftest Skip code for skipped tests 2018-06-18 09:11:10 -06:00
watchdog
x86 selftests/x86/sigreturn: Do minor cleanups 2018-06-27 09:36:56 +02:00
zram selftests: zram: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
.gitignore
gen_kselftest_tar.sh
kselftest_harness.h
kselftest_install.sh
kselftest.h selftests: kselftest: change KSFT_SKIP=4 instead of KSFT_PASS 2018-05-30 15:21:52 -06:00
lib.mk Merge branch 'core-rseq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-06-10 10:17:09 -07:00
Makefile Merge branch 'core-rseq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-06-10 10:17:09 -07:00