aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/stacktrace_map.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2020-03-01 08:10:43 +0000
committerAlexei Starovoitov <[email protected]>2020-03-03 00:49:55 +0000
commit441420a1f0b3031f228453697406c86f110e59d4 (patch)
treed223a75dcdd795660206c0be228148de5c1aa944 /tools/testing/selftests/bpf/prog_tests/stacktrace_map.c
parentMerge branch 'move_BPF_PROG_to_libbpf' (diff)
downloadkernel-441420a1f0b3031f228453697406c86f110e59d4.tar.gz
kernel-441420a1f0b3031f228453697406c86f110e59d4.zip
bpf: Reliably preserve btf_trace_xxx types
btf_trace_xxx types, crucial for tp_btf BPF programs (raw tracepoint with verifier-checked direct memory access), have to be preserved in kernel BTF to allow verifier do its job and enforce type/memory safety. It was reported ([0]) that for kernels built with Clang current type-casting approach doesn't preserve these types. This patch fixes it by declaring an anonymous union for each registered tracepoint, capturing both struct bpf_raw_event_map information, as well as recording btf_trace_##call type reliably. Structurally, it's still the same content as for a plain struct bpf_raw_event_map, so no other changes are necessary. [0] https://github.com/iovisor/bcc/issues/2770#issuecomment-591007692 Fixes: e8c423fb31fa ("bpf: Add typecast to raw_tracepoints to help BTF generation") Reported-by: Wenbo Zhang <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Yonghong Song <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/stacktrace_map.c')
0 files changed, 0 insertions, 0 deletions