selftests/bpf: Cover verifier checks for mutating sockmap/sockhash
authorJakub Sitnicki <jakub@cloudflare.com>
Mon, 27 May 2024 11:20:09 +0000 (13:20 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 27 May 2024 17:34:26 +0000 (19:34 +0200)
commita63bf556160fb19591183383da6757f52119981d
treee6102ba20bfdef0c8312cf878c6e129995581b1c
parent3b9ce0491a43e9af7f108b2f1bced7cd35931660
selftests/bpf: Cover verifier checks for mutating sockmap/sockhash

Verifier enforces that only certain program types can mutate sock{map,hash}
maps, that is update it or delete from it. Add test coverage for these
checks so we don't regress.

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/20240527-sockmap-verify-deletes-v1-3-944b372f2101@cloudflare.com
tools/testing/selftests/bpf/prog_tests/verifier.c
tools/testing/selftests/bpf/progs/verifier_sockmap_mutate.c [new file with mode: 0644]