[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-33974093c024f08caadd2fc71a83bd811ed1831d@git.kernel.org>
Date: Thu, 1 Oct 2009 06:48:50 GMT
From: tip-bot for Matt Fleming <matthew.fleming@...tec.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
fweisbec@...il.com, rostedt@...dmis.org, tglx@...utronix.de,
matthew.fleming@...tec.com, mingo@...e.hu
Subject: [tip:tracing/urgent] tracing: Fix infinite recursion in ftrace_update_pid_func()
Commit-ID: 33974093c024f08caadd2fc71a83bd811ed1831d
Gitweb: http://git.kernel.org/tip/33974093c024f08caadd2fc71a83bd811ed1831d
Author: Matt Fleming <matthew.fleming@...tec.com>
AuthorDate: Mon, 28 Sep 2009 16:43:01 +0100
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Thu, 1 Oct 2009 08:19:24 +0200
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@...tec.com>
Acked-by: Steven Rostedt <rostedt@...dmis.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
LKML-Reference: <1254152581-18347-1-git-send-email-matt@...sole-pimps.org>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
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 46592fe..3724756 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -225,7 +225,11 @@ static void ftrace_update_pid_func(void)
if (ftrace_trace_function == ftrace_stub)
return;
+#ifdef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST
func = ftrace_trace_function;
+#else
+ func = __ftrace_trace_function;
+#endif
if (ftrace_pid_trace) {
set_ftrace_pid_function(func);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists