diff options
author | Steven Rostedt <srostedt@redhat.com> | 2008-12-03 11:04:51 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-03 17:15:03 +0100 |
commit | e8e1abe92fd7ea9d823a3aaf81d10e2cba593b6b (patch) | |
tree | 9ddeaf43558b2ad13c6b4758b17b84781f0217a7 /fs/sysfs/inode.c | |
parent | 0a37119d963e876ca86912497346ec50dea2541b (diff) |
ftrace: fix race in function graph during fork
Impact: graph tracer race/crash fix
There is a nasy race in startup of a new process running the
function graph tracer. In fork.c:
total_forks++;
spin_unlock(¤t->sighand->siglock);
write_unlock_irq(&tasklist_lock);
ftrace_graph_init_task(p);
proc_fork_connector(p);
cgroup_post_fork(p);
return p;
The new task is free to run as soon as the tasklist_lock is released.
This is before the ftrace_graph_init_task. If the task does run
it will be using the same ret_stack and curr_ret_stack as the parent.
This will cause crashes that are difficult to debug.
This patch moves the ftrace_graph_init_task to just after the alloc_pid
code. This fixes the above race.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/sysfs/inode.c')
0 files changed, 0 insertions, 0 deletions