On Sat, Aug 27, 2022 at 1:16 AM Andrii Nakryiko <andrii@xxxxxxxxxx> wrote: > > 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@xxxxxxxxxx> Acked-by: KP Singh <kpsingh@xxxxxxxxxx>