]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/bpf: Add tests for raw_tp null handling
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Mon, 4 Nov 2024 17:19:59 +0000 (09:19 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 4 Nov 2024 19:37:36 +0000 (11:37 -0800)
commitd798ce3f4cab1b0d886b19ec5cc8e6b3d7e35081
treeb956b98fc4eb826326bb8e321144ce40e4bc63ab
parent0e2fb011a0ba8e2258ce776fdf89fbd589c2a3a6
selftests/bpf: Add tests for raw_tp null handling

Ensure that trusted PTR_TO_BTF_ID accesses perform PROBE_MEM handling in
raw_tp program. Without the previous fix, this selftest crashes the
kernel due to a NULL-pointer dereference. Also ensure that dead code
elimination does not kick in for checks on the pointer.

Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20241104171959.2938862-4-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod-events.h
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
tools/testing/selftests/bpf/prog_tests/raw_tp_null.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/raw_tp_null.c [new file with mode: 0644]