diff options
author | Andrii Nakryiko <[email protected]> | 2022-09-09 12:30:52 -0700 |
---|---|---|
committer | Daniel Borkmann <[email protected]> | 2022-09-16 22:39:37 +0200 |
commit | 749c202cb6ea40f4d7ac95c4a1217a7b506f43a8 (patch) | |
tree | 7b6539a5913cb136e857889f7ddd07b1f719affa /tools/lib/bpf/bpf_helpers.h | |
parent | cf060c2c399fa457569123bb9806b455ff53e64c (diff) |
libbpf: Fix crash if SEC("freplace") programs don't have attach_prog_fd set
Fix SIGSEGV caused by libbpf trying to find attach type in vmlinux BTF
for freplace programs. It's wrong to search in vmlinux BTF and libbpf
doesn't even mark vmlinux BTF as required for freplace programs. So
trying to search anything in obj->vmlinux_btf might cause NULL
dereference if nothing else in BPF object requires vmlinux BTF.
Instead, error out if freplace (EXT) program doesn't specify
attach_prog_fd during at the load time.
Fixes: 91abb4a6d79d ("libbpf: Support attachment of BPF tracing programs to kernel modules")
Signed-off-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/bpf_helpers.h')
0 files changed, 0 insertions, 0 deletions