Message ID | 160106910591.27725.1499697900366462609.stgit@toke.dk (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | bpf: Support multi-attach for freplace programs | expand |
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index faf57c6f8804..7fd4757a573d 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -3860,7 +3860,14 @@ bool btf_ctx_access(int off, int size, enum bpf_access_type type, info->reg_type = PTR_TO_BTF_ID; if (dst_prog) { - ret = btf_translate_to_vmlinux(log, btf, t, dst_prog->type, arg); + enum bpf_prog_type dst_type; + + if (dst_prog->type == BPF_PROG_TYPE_EXT) + dst_type = dst_prog->aux->saved_dst_prog_type; + else + dst_type = dst_prog->type; + + ret = btf_translate_to_vmlinux(log, btf, t, dst_type, arg); if (ret > 0) { info->btf_id = ret; return true;