diff options
author | Stanislav Fomichev <[email protected]> | 2022-08-04 13:11:39 -0700 |
---|---|---|
committer | Daniel Borkmann <[email protected]> | 2022-08-08 15:53:17 +0200 |
commit | 6644aabbd8973a9f8008cabfd054a36b69a3a3f5 (patch) | |
tree | 1e03f9cee39a4d071d54bc204637672175a43257 /scripts/gdb/linux/utils.py | |
parent | f1d41f7720c89705c20e4335a807b1c518c2e7be (diff) |
bpf: Use proper target btf when exporting attach_btf_obj_id
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 <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Hao Luo <[email protected]>
Acked-by: Martin KaFai Lau <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions