mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 09:41:03 +02:00
drop_monitor: synchronize tracepoint unregistration on error path
If register_trace_napi_poll() fails in net_dm_trace_on_set(),
unregister_trace_kfree_skb() is called to roll back the kfree_skb
tracepoint registration.
However, tracepoint_synchronize_unregister() is omitted before calling
cancel_work_sync() and module_put(). An in-flight probe executing
concurrently on another CPU could call schedule_work() after
cancel_work_sync() has already returned, leaving a pending work item
scheduled after the module reference is dropped. If the module is then
unloaded, executing the work item triggers a kernel panic.
Add tracepoint_synchronize_unregister() after unregister_trace_kfree_skb()
in the error path, matching net_dm_trace_off_set() and
net_dm_hw_probe_unregister().
Fixes: 7c747838a5 ("drop_monitor: Split tracing enable / disable to different functions")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Link: https://patch.msgid.link/20260910204612.3762015-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
455ebeadf7
commit
6a038ef2b5
|
|
@ -1173,6 +1173,7 @@ static int net_dm_trace_on_set(struct netlink_ext_ack *extack)
|
|||
|
||||
err_unregister_trace:
|
||||
unregister_trace_kfree_skb(ops->kfree_skb_probe, NULL);
|
||||
tracepoint_synchronize_unregister();
|
||||
err_module_put:
|
||||
for_each_possible_cpu(cpu) {
|
||||
struct per_cpu_dm_data *data = &per_cpu(dm_cpu_data, cpu);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user