tasklist-RCU fix in attach_pid()
PATCH 1/1 tasklist-RCU fix in attach_pid()
Hello!
Bug in attach_pid() can result in RCU readers in find_pid() getting confused if they race with process creation.
Signed-off-by <[email protected]>
---
(applies to both 2.6.14-mm1 and -rt)
pid.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
kernel/pid.c +1 -1
@@ -150,6 +150,7 @@ int fastcall attach_pid(task_t *task, en task_pid = &task->pids[type]; pid =find_pid (type, nr); + task_pid->nr = nr;if (pid ==NULL ) {INIT_LIST_HEAD (&task_pid->pid_list); hlist_add_head_rcu(&task_pid->pid_chain,
@@ -158,7 +159,6 @@ int fastcall attach_pid(task_t *task, enINIT_HLIST_NODE (&task_pid->pid_chain);list_add_tail_rcu (&task_pid->pid_list, &pid->pid_list); } - task_pid->nr = nr;return 0 ; }
Quoted 3 lines · Paul E. McKenney
Bug in
attach_pid()can result in RCU readers infind_pid()getting confused if they race with process creation.Signed-off-by <[email protected]>
Simple enough.
Acked-by William Irwin <[email protected]>
-- wli
Quoted 6 lines · Paul E. McKenney
Hello!
Bug in
attach_pid()can result in RCU readers infind_pid()getting confused if they race with process creation.Signed-off-by <[email protected]>
yeah ...
Acked-by Ingo Molnar <[email protected]>
Ingo