]> git.baikalelectronics.ru Git - kernel.git/commit
selftest/bpf: Add a test that reads various addresses.
authorAlexei Starovoitov <ast@kernel.org>
Wed, 15 Dec 2021 20:35:34 +0000 (12:35 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 16 Dec 2021 20:41:13 +0000 (21:41 +0100)
commit1848e971f559ba872303fb873026abb4e94f3135
treee67f6302d7d49c1c331031619e4f66ab13164907
parent85c4806279fdebedf0d90890374b6392f1fe2f23
selftest/bpf: Add a test that reads various addresses.

Add a function to bpf_testmod that returns invalid kernel and user addresses.
Then attach an fexit program to that function that tries to read
memory through these addresses.

This logic checks that bpf_probe_read_kernel and BPF_PROBE_MEM logic is sane.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
tools/testing/selftests/bpf/progs/test_module_attach.c