diff options
author | Matt Fleming <matthew.fleming@imgtec.com> | 2009-09-28 11:43:01 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-01 02:19:24 -0400 |
commit | 33974093c024f08caadd2fc71a83bd811ed1831d (patch) | |
tree | 412ce703796e403697ea00a0d29296b21068f4b0 | |
parent | 84d88d5d4efc37dfb8a93a4a58d8a227ee86ffa4 (diff) |
tracing: Fix infinite recursion in ftrace_update_pid_func()
When CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST is enabled
__ftrace_trace_function contains the current trace function, not
ftrace_trace_function.
In ftrace_update_pid_func() we currently incorrectly assign the
value of ftrace_trace_function to __ftrace_trace_funcion before
returning.
Without this patch it is possible to execute an infinite recursion
whereby ftrace_test_stop_func() calls __ftrace_trace_function,
which was assigned ftrace_test_stop_func() in
ftrace_update_pid_func().
Signed-off-by: Matt Fleming <matthew.fleming@imgtec.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1254152581-18347-1-git-send-email-matt@console-pimps.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/trace/ftrace.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 46592feab5a6..3724756e41ca 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -225,7 +225,11 @@ static void ftrace_update_pid_func(void) | |||
225 | if (ftrace_trace_function == ftrace_stub) | 225 | if (ftrace_trace_function == ftrace_stub) |
226 | return; | 226 | return; |
227 | 227 | ||
228 | #ifdef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST | ||
228 | func = ftrace_trace_function; | 229 | func = ftrace_trace_function; |
230 | #else | ||
231 | func = __ftrace_trace_function; | ||
232 | #endif | ||
229 | 233 | ||
230 | if (ftrace_pid_trace) { | 234 | if (ftrace_pid_trace) { |
231 | set_ftrace_pid_function(func); | 235 | set_ftrace_pid_function(func); |