summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2022-09-09 12:30:52 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2022-09-16 22:39:37 +0200
commit749c202cb6ea40f4d7ac95c4a1217a7b506f43a8 (patch)
tree7b6539a5913cb136e857889f7ddd07b1f719affa /tools/testing/selftests/bpf
parentcf060c2c399fa457569123bb9806b455ff53e64c (diff)
downloadlinux-749c202cb6ea40f4d7ac95c4a1217a7b506f43a8.tar.gz
linux-749c202cb6ea40f4d7ac95c4a1217a7b506f43a8.tar.bz2
linux-749c202cb6ea40f4d7ac95c4a1217a7b506f43a8.zip
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 <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20220909193053.577111-3-andrii@kernel.org
Diffstat (limited to 'tools/testing/selftests/bpf')
0 files changed, 0 insertions, 0 deletions