aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-07-25 04:47:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 13:53:38 -0400
commit92413d771e7123304fb4b9efd2a00cccc946e383 (patch)
treec973360a9bec6c965b9f4b41923357feec14aa3a
parent3854a771821c970065e3203a0b40ddc4101538cc (diff)
signals: dequeue_signal: don't check SIGNAL_GROUP_EXIT when setting SIGNAL_STOP_DEQUEUED
dequeue_signal() checks SIGNAL_GROUP_EXIT before setting SIGNAL_STOP_DEQUEUED. This was added by 788e05a67c343fa22f2ae1d3ca264e7f15c25eaf a long ago to avoid the coredump/SIGSTOP race. Since then the related code was changed, and now this subtle check is both incomplete and unneeded at the same time. It is incomplete because nowadays exec() doesn't set SIGNAL_GROUP_EXIT, so in fact we should check signal_group_exit() to avoid a similar race. Fortunately, we doesn't need the check at all. The only function which relies on SIGNAL_STOP_DEQUEUED is do_signal_stop(), and it ignores this flag if signal_group_exit() == T, this covers the SIGNAL_GROUP_EXIT case. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Acked-by: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/signal.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index fea236fe0b50..15f901a26ec7 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -454,8 +454,7 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
454 * is to alert stop-signal processing code when another 454 * is to alert stop-signal processing code when another
455 * processor has come along and cleared the flag. 455 * processor has come along and cleared the flag.
456 */ 456 */
457 if (!(tsk->signal->flags & SIGNAL_GROUP_EXIT)) 457 tsk->signal->flags |= SIGNAL_STOP_DEQUEUED;
458 tsk->signal->flags |= SIGNAL_STOP_DEQUEUED;
459 } 458 }
460 if ((info->si_code & __SI_MASK) == __SI_TIMER && info->si_sys_private) { 459 if ((info->si_code & __SI_MASK) == __SI_TIMER && info->si_sys_private) {
461 /* 460 /*