bpf: Selftests, verifier case for non null pointer check branch taken
authorJohn Fastabend <john.fastabend@gmail.com>
Thu, 21 May 2020 20:07:46 +0000 (13:07 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 22 May 2020 00:44:25 +0000 (17:44 -0700)
commitc72b5cbb09bd76634b8d19695db2219964e24128
tree6cb646f61e25e65cde2356d79c94a984c38a7512
parentcac616db39c207dc63465a4e05c6ce0e60b2cce4
bpf: Selftests, verifier case for non null pointer check branch taken

When we have pointer type that is known to be non-null and comparing
against zero we only follow the non-null branch. This adds tests to
cover this case for reference tracking. Also add the other case when
comparison against a non-zero value and ensure we still fail with
unreleased reference.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/159009166599.6313.1593680633787453767.stgit@john-Precision-5820-Tower
tools/testing/selftests/bpf/verifier/ref_tracking.c