selftests/bpf: Add read-only map values propagation tests
authorAndrii Nakryiko <andriin@fb.com>
Wed, 9 Oct 2019 20:14:58 +0000 (13:14 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 10 Oct 2019 23:49:15 +0000 (01:49 +0200)
commit666b2c10ee9d51f14d04c416a14b1cb6fd0846e4
tree59d859c0324f8da7eea026033a3ccd8ffec63b05
parenta23740ec43ba022dbfd139d0fe3eff193216272b
selftests/bpf: Add read-only map values propagation tests

Add tests checking that verifier does proper constant propagation for
read-only maps. If constant propagation didn't work, skipp_loop and
part_loop BPF programs would be rejected due to BPF verifier otherwise
not being able to prove they ever complete. With constant propagation,
though, they are succesfully validated as properly terminating loops.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191009201458.2679171-3-andriin@fb.com
tools/testing/selftests/bpf/prog_tests/rdonly_maps.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_rdonly_maps.c [new file with mode: 0644]