]> bbs.cooldavid.org Git - net-next-2.6.git/commit
function-graph: enable the stack after initialization of other variables
authorSteven Rostedt <srostedt@redhat.com>
Tue, 2 Jun 2009 16:26:07 +0000 (12:26 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 2 Jun 2009 18:41:50 +0000 (14:41 -0400)
commit82310a3272d5a2a7652f5649ad8a55f58c8f74d9
treec909c7a3f1fd3430f64be1d4aa8aff84fdf45b04
parent179c498ae2998461fe436437a74dc29036fc7dcc
function-graph: enable the stack after initialization of other variables

The function graph tracer checks if the task_struct has ret_stack defined
to know if it is OK or not to use it. The initialization is done for
all tasks by one process, but the idle tasks use the same initialization
used by new tasks.

If an interrupt happens on an idle task that just had the ret_stack
created, but before the rest of the initialization took place, then
we can corrupt the return address of the functions.

This patch moves the setting of the task_struct's ret_stack to after
the other variables have been initialized.

[ Impact: prevent kernel panic on idle task when starting function graph ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ftrace.c
kernel/trace/trace_functions_graph.c