On Fri, Jul 29, 2022 at 5:08 PM Stanislav Fomichev <sdf@xxxxxxxxxx> wrote: > > When attaching to program, the program itself might not be attached > to anything (and, hence, might not have attach_btf), so we can't > unconditionally use 'prog->aux->dst_prog->aux->attach_btf'. > Instead, use bpf_prog_get_target_btf to pick proper target btf: > > * when attached to dst_prog, use dst_prog->aux->btf > * when attached to kernel btf, use prog->aux->attach_btf > > Fixes: b79c9fc9551b ("bpf: implement BPF_PROG_QUERY for BPF_LSM_CGROUP") > Signed-off-by: Stanislav Fomichev <sdf@xxxxxxxxxx> Looks good to me. Acked-by: Hao Luo <haoluo@xxxxxxxxxx> Hao