bpf, selftests: Add ringbuf memory type confusion test
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 12 Jan 2022 12:39:48 +0000 (12:39 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 19 Jan 2022 00:27:03 +0000 (01:27 +0100)
commit37c8d4807d1b8b521b30310dce97f6695dc2c2c6
tree338441804d596c6fa819c214b8faa5046f74aaac
parent722e4db3ae0d52b2e3801280afbe19cf2d188e91
bpf, selftests: Add ringbuf memory type confusion test

Add two tests, one which asserts that ring buffer memory can be passed to
other helpers for populating its entry area, and another one where verifier
rejects different type of memory passed to bpf_ringbuf_submit().

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/d_path.c
tools/testing/selftests/bpf/progs/test_d_path_check_types.c [new file with mode: 0644]
tools/testing/selftests/bpf/verifier/ringbuf.c
tools/testing/selftests/bpf/verifier/spill_fill.c