diff options
| author | Alexei Starovoitov <[email protected]> | 2023-04-20 18:49:01 -0700 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2023-04-21 16:27:56 +0200 |
| commit | acf1c3d68e9a31f10d92bc67ad4673cdae5e8d92 (patch) | |
| tree | 63a126a226bb5d1f99550916f93f85a2029dacec /tools/perf/scripts/python/exported-sql-viewer.py | |
| parent | 267a6e4e7870beb8896c192da175800e47c82407 (diff) | |
bpf: Fix race between btf_put and btf_idr walk.
Florian and Eduard reported hard dead lock:
[ 58.433327] _raw_spin_lock_irqsave+0x40/0x50
[ 58.433334] btf_put+0x43/0x90
[ 58.433338] bpf_find_btf_id+0x157/0x240
[ 58.433353] btf_parse_fields+0x921/0x11c0
This happens since btf->refcount can be 1 at the time of btf_put() and
btf_put() will call btf_free_id() which will try to grab btf_idr_lock
and will dead lock.
Avoid the issue by doing btf_put() without locking.
Fixes: 3d78417b60fb ("bpf: Add bpf_btf_find_by_name_kind() helper.")
Fixes: 1e89106da253 ("bpf: Add bpf_core_add_cands() and wire it into bpf_core_apply_relo_insn().")
Reported-by: Florian Westphal <[email protected]>
Reported-by: Eduard Zingerman <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Tested-by: Eduard Zingerman <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions