bpf: add various test cases to selftests
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 2 Jan 2019 23:58:35 +0000 (00:58 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 3 Jan 2019 00:01:24 +0000 (16:01 -0800)
commit80c9b2fae87bb5c5698940da1a981f14f89518d1
tree0aec20aa0c87f1cef2241c726cbbc404f5317155
parent979d63d50c0c0f7bc537bf821e056cc9fe5abd38
bpf: add various test cases to selftests

Add various map value pointer related test cases to test_verifier
kselftest to reflect recent changes and improve test coverage. The
tests include basic masking functionality, unprivileged behavior
on pointer arithmetic which goes oob, mixed bounds tests, negative
unknown scalar but resulting positive offset for access and helper
range, handling of arithmetic from multiple maps, various masking
scenarios with subsequent map value access and others including two
test cases from Jann Horn for prior fixes.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/test_verifier.c