projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
be05c94
)
libbpf: Clean gen_loader's attach kind.
author
Alexei Starovoitov
<ast@kernel.org>
Wed, 1 Dec 2021 18:10:34 +0000
(10:10 -0800)
committer
Andrii Nakryiko
<andrii@kernel.org>
Thu, 2 Dec 2021 19:18:35 +0000
(11:18 -0800)
The gen_loader has to clear attach_kind otherwise the programs
without attach_btf_id will fail load if they follow programs
with attach_btf_id.
Fixes:
67234743736a
("libbpf: Generate loader program out of BPF ELF file.")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link:
https://lore.kernel.org/bpf/20211201181040.23337-12-alexei.starovoitov@gmail.com
tools/lib/bpf/gen_loader.c
patch
|
blob
|
blame
|
history
diff --git
a/tools/lib/bpf/gen_loader.c
b/tools/lib/bpf/gen_loader.c
index ed0e949790da2b9f049588303e523321e3fe8b93..21dfb930f1d236526e6b27290725907f7291216b 100644
(file)
--- a/
tools/lib/bpf/gen_loader.c
+++ b/
tools/lib/bpf/gen_loader.c
@@
-1005,9
+1005,11
@@
void bpf_gen__prog_load(struct bpf_gen *gen,
debug_ret(gen, "prog_load %s insn_cnt %d", attr.prog_name, attr.insn_cnt);
/* successful or not, close btf module FDs used in extern ksyms and attach_btf_obj_fd */
cleanup_relos(gen, insns_off);
- if (gen->attach_kind)
+ if (gen->attach_kind)
{
emit_sys_close_blob(gen,
attr_field(prog_load_attr, attach_btf_obj_fd));
+ gen->attach_kind = 0;
+ }
emit_check_err(gen);
/* remember prog_fd in the stack, if successful */
emit(gen, BPF_STX_MEM(BPF_W, BPF_REG_10, BPF_REG_7,