Re: [PATCH rc1-mm] de_thread: fix deadlockable process addition

From: Oleg Nesterov
Date: Fri Apr 07 2006 - 15:50:04 EST


On 04/06, Eric W. Biederman wrote:
>
> Ack. The evils of de_thread!

Yes, just noticed another thing,

[PATCH] task-make-task-list-manipulations-rcu-safe-fix-fix

We shoudn't decrement process_counts if de_thread() unhashed the task.

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>

--- MM/kernel/exit.c~ 2006-04-06 23:01:37.000000000 +0400
+++ MM/kernel/exit.c 2006-04-08 03:35:24.000000000 +0400
@@ -56,9 +56,10 @@ static void __unhash_process(struct task
detach_pid(p, PIDTYPE_SID);

/* see de_thread()->list_replace_rcu() */
- if (likely(p->tasks.prev != LIST_POISON2))
+ if (likely(p->tasks.prev != LIST_POISON2)) {
list_del_rcu(&p->tasks);
- __get_cpu_var(process_counts)--;
+ __get_cpu_var(process_counts)--;
+ }
}
list_del_rcu(&p->thread_group);
remove_parent(p);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/