lkml.org 
[lkml]   [2003]   [Aug]   [12]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateTue, 12 Aug 2003 00:52:26 -0700
FromRoland McGrath <>
Subject[PATCH] revert zap_other_threads breakage, disallow CLONE_THREAD without CLONE_DETACHED
Please apply this patch to get us back out of this useless quagmire and
disallow the problematic case that noone wants to try to use any more.


Thanks,
Roland


--- linux/kernel/fork.c	18 Jul 2003 16:27:39 -0000	1.142
+++ linux/kernel/fork.c	12 Aug 2003 06:20:05 -0000
@@ -744,7 +749,8 @@ struct task_struct *copy_process(unsigne
 	 * Thread groups must share signals as well, and detached threads
 	 * can only be started up within the thread group.
 	 */
-	if ((clone_flags & CLONE_THREAD) && !(clone_flags & CLONE_SIGHAND))
+	if ((clone_flags & CLONE_THREAD) &&
+	    (clone_flags & (CLONE_SIGHAND|CLONE_DETACHED)) != (CLONE_SIGHAND|CLONE_DETACHED))
 		return ERR_PTR(-EINVAL);
 	if ((clone_flags & CLONE_DETACHED) && !(clone_flags & CLONE_THREAD))
 		return ERR_PTR(-EINVAL);
--- linux/kernel/signal.c	7 Aug 2003 20:06:12 -0000	1.98
+++ linux/kernel/signal.c	12 Aug 2003 06:18:34 -0000
@@ -1005,16 +1016,6 @@ void zap_other_threads(struct task_struc
 		 */
 		if (t->state & (TASK_ZOMBIE|TASK_DEAD))
 			continue;
-
-		/*
-		 * We don't want to notify the parent, since we are
-		 * 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.
-		 */
-		t->exit_signal = -1;
-
 		sigaddset(&t->pending.signal, SIGKILL);
 		rm_from_queue(SIG_KERNEL_STOP_MASK, &t->pending);
 		signal_wake_up(t, 1);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:47    [from the cache]
©2003-2008