From: Roland McGrath <roland@redhat.com>
To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
Cc: Matt Wilson <msw@redhat.com>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
Jeremy Fitzhardinge <jeremy@goop.org>
Subject: [PATCH] revert zap_other_threads breakage, disallow CLONE_THREAD without CLONE_DETACHED
Date: Tue, 12 Aug 2003 00:52:26 -0700 [thread overview]
Message-ID: <200308120752.h7C7qQT20085@magilla.sf.frob.com> (raw)
In-Reply-To: Roland McGrath's message of Tuesday, 12 August 2003 00:40:52 -0700 <200308120740.h7C7eqV20032@magilla.sf.frob.com>
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);
next prev parent reply other threads:[~2003-08-12 7:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-09 19:17 [PATCH] zap_other_threads() detaches thread group leader Matt Wilson
2003-08-12 7:40 ` Roland McGrath
2003-08-12 7:52 ` Roland McGrath [this message]
2003-08-13 7:11 ` [PATCH] revert zap_other_threads breakage, disallow CLONE_THREAD without CLONE_DETACHED Jeremy Fitzhardinge
2003-08-13 9:37 ` Roland McGrath
2003-08-14 17:32 ` Linus Torvalds
2003-08-14 17:53 ` Jamie Lokier
2003-08-14 18:03 ` Linus Torvalds
2003-08-14 18:27 ` Jamie Lokier
2003-08-14 18:33 ` Linus Torvalds
2003-08-14 18:38 ` Jamie Lokier
2003-08-14 20:56 ` Roland McGrath
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200308120752.h7C7qQT20085@magilla.sf.frob.com \
--to=roland@redhat.com \
--cc=akpm@osdl.org \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=msw@redhat.com \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®