OSDN Git Service

selftests: bpf: test writable buffers in raw tps
authorMatt Mullins <mmullins@fb.com>
Fri, 26 Apr 2019 18:49:51 +0000 (11:49 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 27 Apr 2019 02:04:19 +0000 (19:04 -0700)
commite950e843367d7990b9d7ea964e3c33876d477c4b
tree9fe461c7f01adec95c4f66d9a4748afa3348643b
parent4635b0ae4d26f87cf68dbab6740955dd1ad67cf4
selftests: bpf: test writable buffers in raw tps

This tests that:
  * a BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE cannot be attached if it
    uses either:
    * a variable offset to the tracepoint buffer, or
    * an offset beyond the size of the tracepoint buffer
  * a tracer can modify the buffer provided when attached to a writable
    tracepoint in bpf_prog_test_run

Signed-off-by: Matt Mullins <mmullins@fb.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/trace/events/bpf_test_run.h [new file with mode: 0644]
net/bpf/test_run.c
tools/testing/selftests/bpf/prog_tests/raw_tp_writable_reject_nbd_invalid.c [new file with mode: 0644]
tools/testing/selftests/bpf/prog_tests/raw_tp_writable_test_run.c [new file with mode: 0644]
tools/testing/selftests/bpf/verifier/raw_tp_writable.c [new file with mode: 0644]