fork() && ftrace_graph_exit_task()
What if the task with ->ret_stack != NULL calls fork(), and copy_prcoess() fails after successfull dup_task_struct() ?
bad_fork_free: -> free_task()->ftrace_graph_exit_task() will free the parent's ->ret_stack copied by arch_dup_task_struct(), no?
Oleg.
Quoted 9 lines · Oleg Nesterov
What if the task with ->ret_stack != NULL calls
fork(), andcopy_prcoess()fails after successfulldup_task_struct()?
bad_fork_free: -> free_task()->ftrace_graph_exit_task() will free the parent's ->ret_stack copied byarch_dup_task_struct(), no?Oleg.
Good catch, that's a rare situation but very dangerous.
I will fix it, thanks for your report!
Frederic.