diff options
author | Alexei Starovoitov <ast@kernel.org> | 2025-02-25 01:16:37 +0300 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2025-02-26 19:48:40 +0300 |
commit | 4580f4e0ebdf8dc8d506ae926b88510395a0c1d1 (patch) | |
tree | b211ddcd69bbd482b2ac339f186d84b0d94b703d /scripts/lib/kdoc/kdoc_parser.py | |
parent | b123480eec64dd879785c28f2a2d582d111cfb59 (diff) | |
download | linux-4580f4e0ebdf8dc8d506ae926b88510395a0c1d1.tar.xz |
bpf: Fix deadlock between rcu_tasks_trace and event_mutex.
Fix the following deadlock:
CPU A
_free_event()
perf_kprobe_destroy()
mutex_lock(&event_mutex)
perf_trace_event_unreg()
synchronize_rcu_tasks_trace()
There are several paths where _free_event() grabs event_mutex
and calls sync_rcu_tasks_trace. Above is one such case.
CPU B
bpf_prog_test_run_syscall()
rcu_read_lock_trace()
bpf_prog_run_pin_on_cpu()
bpf_prog_load()
bpf_tracing_func_proto()
trace_set_clr_event()
mutex_lock(&event_mutex)
Delegate trace_set_clr_event() to workqueue to avoid
such lock dependency.
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/20250224221637.4780-1-alexei.starovoitov@gmail.com
Diffstat (limited to 'scripts/lib/kdoc/kdoc_parser.py')
0 files changed, 0 insertions, 0 deletions