diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 4f0266b668e..5da4866d638 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -794,6 +794,17 @@ thread_suspend_check(int return_instead) (p->p_flag & P_SINGLE_BOUNDARY) && return_instead) return (ERESTART); + /* + * Ignore suspend requests for stop signals if they + * are deferred. + */ + if (P_SHOULDSTOP(p) == P_STOPPED_SIG && + td->td_flags & TDF_SBDRY) { + KASSERT(return_instead, + ("TDF_SBDRY set for unsafe thread_suspend_check")); + return (0); + } + /* * If the process is waiting for us to exit, * this thread should just suicide.