selftests/bpf: Add verifier tests for better jmp32 register bounds
authorYonghong Song <yhs@fb.com>
Thu, 21 Nov 2019 17:06:51 +0000 (09:06 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 25 Nov 2019 00:58:46 +0000 (16:58 -0800)
commit260cb5df9d16c5715b32d73cc8af26ad9a17a792
treedc410e35bdb263512e095f64aed2456b19e132d8
parent581738a681b6faae5725c2555439189ca81c0f1f
selftests/bpf: Add verifier tests for better jmp32 register bounds

Three test cases are added.
Test 1: jmp32 'reg op imm'.
Test 2: jmp32 'reg op reg' where dst 'reg' has unknown constant
        and src 'reg' has known constant
Test 3: jmp32 'reg op reg' where dst 'reg' has known constant
        and src 'reg' has unknown constant

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191121170651.449096-1-yhs@fb.com
tools/testing/selftests/bpf/verifier/jmp32.c