diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2020-12-31 01:45:12 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2021-01-10 02:41:19 +0000 |
commit | e0d83cd3e49f0b9e16bc82ced7bd3b0ef9aa6a71 (patch) | |
tree | 55272d1cad32a049952f4f8f2e13ddd5c31d748b /sys/kern/kern_sig.c | |
parent | 993a1699b1948d30c4903440e8d8b23a7d5fc6c5 (diff) | |
download | src-e0d83cd3e49f0b9e16bc82ced7bd3b0ef9aa6a71.tar.gz src-e0d83cd3e49f0b9e16bc82ced7bd3b0ef9aa6a71.zip |
issignal(): when handling STOP-like signals, drop sigacts mutex earlier.
Reviewed by: jilles
Tested by: pho
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27871
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r-- | sys/kern/kern_sig.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index b1b4ccf4357c..c5899f19ee08 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2984,17 +2984,20 @@ issignal(struct thread *td) * should ignore tty stops. */ if (prop & SIGPROP_STOP) { + mtx_unlock(&ps->ps_mtx); if ((p->p_flag & (P_TRACED | P_WEXIT | P_SINGLE_EXIT)) != 0 || (p->p_pgrp->pg_jobc == 0 && - (prop & SIGPROP_TTYSTOP) != 0)) + (prop & SIGPROP_TTYSTOP) != 0)) { + mtx_lock(&ps->ps_mtx); break; /* == ignore */ + } if (TD_SBDRY_INTR(td)) { KASSERT((td->td_flags & TDF_SBDRY) != 0, ("lost TDF_SBDRY")); + mtx_lock(&ps->ps_mtx); return (-1); } - mtx_unlock(&ps->ps_mtx); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, &p->p_mtx.lock_object, "Catching SIGSTOP"); sigqueue_delete(&td->td_sigqueue, sig); |