summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2017-05-19 10:16:51 +0000
committerkib <kib@FreeBSD.org>2017-05-19 10:16:51 +0000
commit33a10fbef284be20d501b13bdbe159ac4b6be9af (patch)
tree5cfabfed649b666ac9018616c6b6d304105a0e2b /sys/kern
parent133ba8d4930fb32f914abf76d2c1ae0606eea8db (diff)
downloadFreeBSD-src-33a10fbef284be20d501b13bdbe159ac4b6be9af.zip
FreeBSD-src-33a10fbef284be20d501b13bdbe159ac4b6be9af.tar.gz
MFC r318243:
Do not wake up sleeping thread in reschedule_signals() if the signal is blocked. The spurious wakeup might result in spurious EINTR. PR: 219228
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sig.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index f80ac3d..f402d25 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -2637,7 +2637,9 @@ reschedule_signals(struct proc *p, sigset_t block, int flags)
signotify(td);
if (!(flags & SIGPROCMASK_PS_LOCKED))
mtx_lock(&ps->ps_mtx);
- if (p->p_flag & P_TRACED || SIGISMEMBER(ps->ps_sigcatch, sig))
+ if (p->p_flag & P_TRACED ||
+ (SIGISMEMBER(ps->ps_sigcatch, sig) &&
+ !SIGISMEMBER(td->td_sigmask, sig)))
tdsigwakeup(td, sig, SIG_CATCH,
(SIGISMEMBER(ps->ps_sigintr, sig) ? EINTR :
ERESTART));
OpenPOWER on IntegriCloud