From: Manfred Spraul <manfred@colorfullife.com>

de_thread calls list_del(&current->tasks), but current->tasks was never 
added to the task list. The structure contains stale values from the parent.

switch_exec_pid() transforms a normal thread to a thread group leader. 
Thread group leaders are included in the init_task.tasks linked list,
non-leaders are not in that list.  The patch adds the new thread group
leader to the linked list, otherwise de_thread corrupts the task list.



 kernel/pid.c |    1 +
 1 files changed, 1 insertion(+)

diff -puN kernel/pid.c~de_thread-fix kernel/pid.c
--- 25/kernel/pid.c~de_thread-fix	2003-05-12 21:23:24.000000000 -0700
+++ 25-akpm/kernel/pid.c	2003-05-12 21:23:24.000000000 -0700
@@ -252,6 +252,7 @@ void switch_exec_pids(task_t *leader, ta
 	attach_pid(thread, PIDTYPE_TGID, thread->tgid);
 	attach_pid(thread, PIDTYPE_PGID, thread->pgrp);
 	attach_pid(thread, PIDTYPE_SID, thread->session);
+	list_add_tail(&thread->tasks, &init_task.tasks);
 
 	attach_pid(leader, PIDTYPE_PID, leader->pid);
 	attach_pid(leader, PIDTYPE_TGID, leader->tgid);

_