selftests/bpf: adjust verifier scale test
authorAlexei Starovoitov <ast@kernel.org>
Wed, 22 May 2019 03:14:20 +0000 (20:14 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 23 May 2019 14:20:57 +0000 (16:20 +0200)
commit7c0c6095d48dcd0e67c917aa73cdbb2715aafc36
tree973bcd22387f0268739482009a3c04560bc95909
parentb285fcb760da7aa87d6d31e6c6a4907d82d9299c
selftests/bpf: adjust verifier scale test

Adjust scale tests to check for new jmp sequence limit.

BPF_JGT had to be changed to BPF_JEQ because the verifier was
too smart. It tracked the known safe range of R0 values
and pruned the search earlier before hitting exact 8192 limit.
bpf_semi_rand_get() was too (un)?lucky.

k = 0; was missing in bpf_fill_scale2.
It was testing a bit shorter sequence of jumps than intended.

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