linux/tools/testing/selftests/bpf
Gianluca Borello 3c839744b3 bpf: Preserve const register type on const OR alu ops
Occasionally, clang (e.g. version 3.8.1) translates a sum between two
constant operands using a BPF_OR instead of a BPF_ADD. The verifier is
currently not handling this scenario, and the destination register type
becomes UNKNOWN_VALUE even if it's still storing a constant. As a result,
the destination register cannot be used as argument to a helper function
expecting a ARG_CONST_STACK_*, limiting some use cases.

Modify the verifier to handle this case, and add a few tests to make sure
all combinations are supported, and stack boundaries are still verified
even with BPF_OR.

Signed-off-by: Gianluca Borello <g.borello@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-05 13:40:05 -05:00
..
.gitignore bpf: Preserve const register type on const OR alu ops 2016-12-05 13:40:05 -05:00
bpf_sys.h bpf: add initial suite for selftests 2016-10-18 11:35:55 -04:00
bpf_util.h bpf: fix multiple issues in selftest suite and samples 2016-11-27 20:38:47 -05:00
config bpf: add initial suite for selftests 2016-10-18 11:35:55 -04:00
Makefile bpf: Add tests for the LRU bpf_htab 2016-11-15 11:50:43 -05:00
test_kmod.sh bpf: add initial suite for selftests 2016-10-18 11:35:55 -04:00
test_lru_map.c bpf: fix multiple issues in selftest suite and samples 2016-11-27 20:38:47 -05:00
test_maps.c bpf: fix multiple issues in selftest suite and samples 2016-11-27 20:38:47 -05:00
test_verifier.c bpf: Preserve const register type on const OR alu ops 2016-12-05 13:40:05 -05:00