Commit 3ae4cbad authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

exit_notify: don't take tasklist for TIF_SIGPENDING re-targeting

->siglock provides enough protection to iterate over the thread group.
Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
Acked-by: default avatarRoland McGrath <roland@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2f4e6e2a
...@@ -747,13 +747,11 @@ static void exit_notify(struct task_struct *tsk) ...@@ -747,13 +747,11 @@ static void exit_notify(struct task_struct *tsk)
* Now we'll wake all the threads in the group just to make * Now we'll wake all the threads in the group just to make
* sure someone gets all the pending signals. * sure someone gets all the pending signals.
*/ */
read_lock(&tasklist_lock);
spin_lock_irq(&tsk->sighand->siglock); spin_lock_irq(&tsk->sighand->siglock);
for (t = next_thread(tsk); t != tsk; t = next_thread(t)) for (t = next_thread(tsk); t != tsk; t = next_thread(t))
if (!signal_pending(t) && !(t->flags & PF_EXITING)) if (!signal_pending(t) && !(t->flags & PF_EXITING))
recalc_sigpending_and_wake(t); recalc_sigpending_and_wake(t);
spin_unlock_irq(&tsk->sighand->siglock); spin_unlock_irq(&tsk->sighand->siglock);
read_unlock(&tasklist_lock);
} }
write_lock_irq(&tasklist_lock); write_lock_irq(&tasklist_lock);
...@@ -781,7 +779,6 @@ static void exit_notify(struct task_struct *tsk) ...@@ -781,7 +779,6 @@ static void exit_notify(struct task_struct *tsk)
* and we were the only connection outside, so our pgrp * and we were the only connection outside, so our pgrp
* is about to become orphaned. * is about to become orphaned.
*/ */
t = tsk->real_parent; t = tsk->real_parent;
pgrp = task_pgrp(tsk); pgrp = task_pgrp(tsk);
......
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