]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: fix and add test cases for ARG_CONST_SIZE_OR_ZERO semantics change
authorYonghong Song <yhs@fb.com>
Sun, 12 Nov 2017 22:49:11 +0000 (14:49 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Nov 2017 07:20:03 +0000 (16:20 +0900)
commit1b636989604072de18bc2399d2c15fbf52ffcae3
tree9fb5554961eecb8be5a8de7b84675fc6708afb32
parent2e22277eebd5cc61d01ac667d9855d47bb9a2645
bpf: fix and add test cases for ARG_CONST_SIZE_OR_ZERO semantics change

Fix a few test cases to allow non-NULL map/packet/stack pointer
with size = 0. Change a few tests using bpf_probe_read to use
bpf_probe_write_user so ARG_CONST_SIZE arg can still be properly
tested. One existing test case already covers size = 0 with non-NULL
packet pointer, so add additional tests so all cases of
size = 0 and 0 <= size <= legal_upper_bound with non-NULL
map/packet/stack pointer are covered.

Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/bpf/test_verifier.c