diff options
author | Roland McGrath <roland@redhat.com> | 2007-05-23 16:57:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-23 23:14:12 -0400 |
commit | 7bb44adef39ad3bda2be40bb34686bc56bd563a5 (patch) | |
tree | 1e9eecbd03877c7ac8b00a8cb1d4ae54ebec3bb1 /include/linux | |
parent | 3c6df2a9177c010bf811c361149069e4bfd9bb11 (diff) |
recalc_sigpending_tsk fixes
Steve Hawkes discovered a problem where recalc_sigpending_tsk was called in
do_sigaction but no signal_wake_up call was made, preventing later signals
from waking up blocked threads with TIF_SIGPENDING already set.
In fact, the few other calls to recalc_sigpending_tsk outside the signals
code are also subject to this problem in other race conditions.
This change makes recalc_sigpending_tsk private to the signals code. It
changes the outside calls, as well as do_sigaction, to use the new
recalc_sigpending_and_wake instead.
Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: <Steve.Hawkes@motorola.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/sched.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 870b75e348ab..d58e74b98367 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1616,11 +1616,13 @@ static inline int lock_need_resched(spinlock_t *lock) | |||
1616 | return 0; | 1616 | return 0; |
1617 | } | 1617 | } |
1618 | 1618 | ||
1619 | /* Reevaluate whether the task has signals pending delivery. | 1619 | /* |
1620 | This is required every time the blocked sigset_t changes. | 1620 | * Reevaluate whether the task has signals pending delivery. |
1621 | callers must hold sighand->siglock. */ | 1621 | * Wake the task if so. |
1622 | 1622 | * This is required every time the blocked sigset_t changes. | |
1623 | extern FASTCALL(void recalc_sigpending_tsk(struct task_struct *t)); | 1623 | * callers must hold sighand->siglock. |
1624 | */ | ||
1625 | extern void recalc_sigpending_and_wake(struct task_struct *t); | ||
1624 | extern void recalc_sigpending(void); | 1626 | extern void recalc_sigpending(void); |
1625 | 1627 | ||
1626 | extern void signal_wake_up(struct task_struct *t, int resume_stopped); | 1628 | extern void signal_wake_up(struct task_struct *t, int resume_stopped); |