summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2003-05-12 09:12:34 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-05-12 09:12:34 -0700
commit172edfcb3102374aef9b7730aba42865fee1b644 (patch)
tree79629528215881c45f9719bd8b2d9588706ae321 /kernel
parent7953a508f3c00555b6f296c3e5bf68914b82b87b (diff)
[PATCH] de_thread memory corruption fix
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.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/pid.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/pid.c b/kernel/pid.c
index f5afb3137e74..00413e3967b9 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -252,6 +252,7 @@ void switch_exec_pids(task_t *leader, task_t *thread)
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);