]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: add test for the verifier equal logic bug
authorJosef Bacik <jbacik@fb.com>
Tue, 29 Nov 2016 17:35:19 +0000 (12:35 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Nov 2016 19:51:54 +0000 (14:51 -0500)
commit70b0d463ac6d96803f7c587ced786565f71bc221
treeb29ed2aec03f74d7f13fd5b6407751abbcb568d9
parentde3b4193c5036993ed89b8e28dc22a4e59fab812
bpf: add test for the verifier equal logic bug

This is a test to verify that

bpf: fix states equal logic for varlen access

actually fixed the problem.  The problem was if the register we added to our map
register was UNKNOWN in both the false and true branches and the only thing that
changed was the range then we'd incorrectly assume that the true branch was
valid, which it really wasnt.  This tests this case and properly fails without
my fix in place and passes with it in place.

Signed-off-by: Josef Bacik <jbacik@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