[lkml]   [2003]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] zap_other_threads() detaches thread group leader

The change to detach the threads in zap_other_threads() broke the case
where the non-thread-group-leader is the cause of de_thread(). In
this case the group leader will be detached and freed before
switch_exec_pids() is complete and invalid data will be used.
This is a patch that makes sure that the group leader does not get
detached and reaped.

Thought that Ingo or Roland submitted this for me, but since it's
still not in test3 I figured I would send it myself. Please CC: me on



--- linux-2.6.0-test3/kernel/signal.c.zap 2003-08-09 14:58:50.000000000 -0400
+++ linux-2.6.0-test3/kernel/signal.c 2003-08-09 14:59:42.000000000 -0400
@@ -1011,9 +1011,11 @@ void zap_other_threads(struct task_struc
* killed as part of a thread group due to another
* thread doing an execve() or similar. So set the
* exit signal to -1 to allow immediate reaping of
- * the process.
+ * the process. But don't detach the thread group
+ * leader.
- t->exit_signal = -1;
+ if (t != p->group_leader)
+ t->exit_signal = -1;

sigaddset(&t->pending.signal, SIGKILL);
rm_from_queue(SIG_KERNEL_STOP_MASK, &t->pending);
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2005-03-22 13:47    [W:0.136 / U:0.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site