kernel_optimize_test/tools
Yonghong Song 332270fdc8 bpf: enhance verifier to understand stack pointer arithmetic
llvm 4.0 and above generates the code like below:
....
440: (b7) r1 = 15
441: (05) goto pc+73
515: (79) r6 = *(u64 *)(r10 -152)
516: (bf) r7 = r10
517: (07) r7 += -112
518: (bf) r2 = r7
519: (0f) r2 += r1
520: (71) r1 = *(u8 *)(r8 +0)
521: (73) *(u8 *)(r2 +45) = r1
....
and the verifier complains "R2 invalid mem access 'inv'" for insn #521.
This is because verifier marks register r2 as unknown value after #519
where r2 is a stack pointer and r1 holds a constant value.

Teach verifier to recognize "stack_ptr + imm" and
"stack_ptr + reg with const val" as valid stack_ptr with new offset.

Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-01 11:40:23 -04:00
..
accounting
arch
build bpf: Add sparc support to tools and samples. 2017-04-22 13:01:52 -07:00
cgroup
firewire
gpio
hv
iio
include bpf: add napi_id read access to __sk_buff 2017-04-21 13:53:27 -04:00
kvm/kvm_stat
laptop
leds
lguest
lib bpf: Add sparc support to tools and samples. 2017-04-22 13:01:52 -07:00
net
nfsd
objtool
pcmcia
perf
power
scripts
spi
testing bpf: enhance verifier to understand stack pointer arithmetic 2017-05-01 11:40:23 -04:00
thermal/tmon
time
usb
virtio
vm
Makefile