Skip to content

Commit 740466b

Browse files
rostedtSteven Rostedt
authored andcommitted
tracing: Fix free of probe entry by calling call_rcu_sched()
Because function tracing is very invasive, and can even trace calls to rcu_read_lock(), RCU access in function tracing is done with preempt_disable_notrace(). This requires a synchronize_sched() for updates and not a synchronize_rcu(). Function probes (traceon, traceoff, etc) must be freed after a synchronize_sched() after its entry has been removed from the hash. But call_rcu() is used. Fix this by using call_rcu_sched(). Also fix the usage to use hlist_del_rcu() instead of hlist_del(). Cc: [email protected] Cc: Paul McKenney <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent 2721e72 commit 740466b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/trace/ftrace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3108,8 +3108,8 @@ __unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
31083108
continue;
31093109
}
31103110

3111-
hlist_del(&entry->node);
3112-
call_rcu(&entry->rcu, ftrace_free_entry_rcu);
3111+
hlist_del_rcu(&entry->node);
3112+
call_rcu_sched(&entry->rcu, ftrace_free_entry_rcu);
31133113
}
31143114
}
31153115
__disable_ftrace_function_probe();

0 commit comments

Comments
 (0)