selftests/bpf: Test that lookup on SOCKMAP/SOCKHASH is allowed
authorJakub Sitnicki <jakub@cloudflare.com>
Wed, 29 Apr 2020 18:11:53 +0000 (20:11 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 29 Apr 2020 21:30:59 +0000 (23:30 +0200)
commit34a2cc6eee809f974111979f4c2b3c62aaaad457
tree0d040f5dfba95a525da7a3046a73a06e79a87e2d
parent64d85290d79c0677edb5a8ee2295b36c022fa5df
selftests/bpf: Test that lookup on SOCKMAP/SOCKHASH is allowed

Now that bpf_map_lookup_elem() is white-listed for SOCKMAP/SOCKHASH,
replace the tests which check that verifier prevents lookup on these map
types with ones that ensure that lookup operation is permitted, but only
with a release of acquired socket reference.

Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20200429181154.479310-3-jakub@cloudflare.com
tools/testing/selftests/bpf/verifier/prevent_map_lookup.c
tools/testing/selftests/bpf/verifier/sock.c