linux-stable/kernel/trace
Steven Rostedt (VMware) 736214625a ftrace: Move RCU is watching check after recursion check
commit b40341fad6 upstream.

The first thing that the ftrace function callback helper functions should do
is to check for recursion. Peter Zijlstra found that when
"rcu_is_watching()" had its notrace removed, it caused perf function tracing
to crash. This is because the call of rcu_is_watching() is tested before
function recursion is checked and and if it is traced, it will cause an
infinite recursion loop.

rcu_is_watching() should still stay notrace, but to prevent this should
never had crashed in the first place. The recursion prevention must be the
first thing done in callback functions.

Link: https://lore.kernel.org/r/20200929112541.GM2628@hirez.programming.kicks-ass.net

Cc: stable@vger.kernel.org
Cc: Paul McKenney <paulmck@kernel.org>
Fixes: c68c0fa293 ("ftrace: Have ftrace_ops_get_func() handle RCU and PER_CPU flags too")
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reported-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-14 09:51:11 +02:00
..
blktrace.c blktrace: ensure our debugfs dir exists 2020-09-03 11:22:25 +02:00
bpf_trace.c
ftrace.c ftrace: Move RCU is watching check after recursion check 2020-10-14 09:51:11 +02:00
Kconfig Stop the ad-hoc games with -Wno-maybe-initialized 2020-05-20 08:17:10 +02:00
Makefile
power-traces.c
ring_buffer.c trace: Fix preempt_enable_no_resched() abuse 2019-05-02 09:40:28 +02:00
ring_buffer_benchmark.c
rpm-traces.c
trace.c tracing: Use address-of operator on section symbols 2020-10-01 13:12:38 +02:00
trace.h ftrace: Protect ftrace_graph_hash with ftrace_sync 2020-02-14 16:32:13 -05:00
trace_benchmark.c
trace_benchmark.h
trace_branch.c Revert "x86/uaccess, ftrace: Fix ftrace_likely_update() vs. SMAP" 2019-07-03 13:15:57 +02:00
trace_clock.c
trace_entries.h tracing: Set kernel_stack's caller size properly 2020-10-01 13:12:32 +02:00
trace_event_perf.c
trace_events.c tracing: Adding NULL checks for trace_array descriptor pointer 2020-10-01 13:12:28 +02:00
trace_events_filter.c
trace_events_filter_test.h
trace_events_hist.c
trace_events_trigger.c tracing: Fix event trigger to accept redundant spaces 2020-06-30 15:38:08 -04:00
trace_export.c
trace_functions.c
trace_functions_graph.c tracing/fgraph: Fix set_graph_function from showing interrupts 2019-05-16 19:42:27 +02:00
trace_hwlat.c tracing/hwlat: Honor the tracing_cpumask 2020-08-21 09:48:19 +02:00
trace_irqsoff.c tracing/fgraph: Fix set_graph_function from showing interrupts 2019-05-16 19:42:27 +02:00
trace_kdb.c tracing: Silence GCC 9 array bounds warning 2019-06-25 11:36:50 +08:00
trace_kprobe.c ftrace/kprobe: Show the maxactive number on kprobe_events 2020-04-24 08:00:50 +02:00
trace_mmiotrace.c
trace_nop.c
trace_output.c
trace_output.h
trace_printk.c
trace_probe.c
trace_probe.h
trace_sched_switch.c tracing: Fix sched switch start/stop refcount racy updates 2020-02-14 16:32:07 -05:00
trace_sched_wakeup.c kernel/trace: Fix do not unregister tracepoints when register sched_migrate_task fail 2020-01-14 20:05:40 +01:00
trace_selftest.c
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c tracing: Have stack tracer compile when MCOUNT_INSN_SIZE is not defined 2020-01-14 20:05:40 +01:00
trace_stat.c tracing: Fix very unlikely race of registering two stat tracers 2020-02-28 16:35:58 +01:00
trace_stat.h
trace_syscalls.c
trace_uprobe.c
tracing_map.c tracing: Have the histogram compare functions convert to u64 first 2020-01-09 10:17:56 +01:00
tracing_map.h