Commit-ID: 77c60400c82bd9935de08ea133e761a7e996bb82 Gitweb: http://git.kernel.org/tip/77c60400c82bd9935de08ea133e761a7e996bb82 Author: Thomas Gleixner <tglx@xxxxxxxxxxxxx> AuthorDate: Mon, 24 Apr 2017 22:54:20 +0200 Committer: Thomas Gleixner <tglx@xxxxxxxxxxxxx> CommitDate: Mon, 24 Apr 2017 22:54:20 +0200 trace: Prevent CPU hotplug in trace_event_enable_cmd_record() The lockdep assertion in __static_key_slow_inc() triggers from the following call chain: __static_key_slow_inc+0xae/0xf4 static_key_slow_inc_cpuslocked+0x8/0xa tracepoint_probe_register_prio+0x38d/0x3aa tracepoint_probe_register+0xa/0xc tracing_start_cmdline_record+0x4c/0x111 trace_printk_start_comm+0x28/0x2a trace_event_init+0x1e0/0x1ed trace_init+0x410/0x417 trace_event_enable_cmd_record() which is the actual caller of tracepoint_probe_register() lacks the hotplug protection. Add it. Reported-by: Xiaolong Ye <xiaolong.ye@xxxxxxxxx> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx> --- kernel/trace/trace_events.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 8156bfd..4330b1d 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -326,6 +326,7 @@ void trace_event_enable_cmd_record(bool enable) struct trace_event_file *file; struct trace_array *tr; + get_online_cpus(); mutex_lock(&event_mutex); do_for_each_event_file(tr, file) { @@ -341,6 +342,7 @@ void trace_event_enable_cmd_record(bool enable) } } while_for_each_event_file(); mutex_unlock(&event_mutex); + put_online_cpus(); } static int __ftrace_event_enable_disable(struct trace_event_file *file, -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
![]() |