OSDN Git Service

selftests/bpf: Test access to bpf map pointer
authorAndrey Ignatov <rdna@fb.com>
Fri, 19 Jun 2020 21:11:45 +0000 (14:11 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 22 Jun 2020 20:22:59 +0000 (22:22 +0200)
commitb1b53d413f16c6b5078edb127e660e67332e4d2f
tree063a66799b0a01640a1b0b36ce3107011b4be423
parent2872e9ac33a4440173418147351ed4f93177e763
selftests/bpf: Test access to bpf map pointer

Add selftests to test access to map pointers from bpf program for all
map types except struct_ops (that one would need additional work).

verifier test focuses mostly on scenarios that must be rejected.

prog_tests test focuses on accessing multiple fields both scalar and a
nested struct from bpf program and verifies that those fields have
expected values.

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/139a6a17f8016491e39347849b951525335c6eb4.1592600985.git.rdna@fb.com
tools/testing/selftests/bpf/prog_tests/map_ptr.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/map_ptr_kern.c [new file with mode: 0644]
tools/testing/selftests/bpf/verifier/map_ptr.c [new file with mode: 0644]