Commit 3b3b14de authored by Linus Torvalds's avatar Linus Torvalds

When zapping the thread list due to an execve(), make sure to

also detach the threads.

Otherwise we'll leave them around as zombies, waiting for them
to be picked up by their parent. Which might be the execve()
thread itself, causing a deadlock.
parent 176a9075
......@@ -1000,6 +1000,15 @@ void zap_other_threads(struct task_struct *p)
return;
for (t = next_thread(p); t != p; t = next_thread(t)) {
/*
* 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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment