summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-05-23 19:09:04 +0000
committerkib <kib@FreeBSD.org>2015-05-23 19:09:04 +0000
commit0638a68fdec54d763ffbe77a8375f8c083c3650e (patch)
tree18607563dbac90391e5be19f52616b12dae4a0c4
parent7ec6cd48d050f08cc2fd1c978fd1814c690db4cf (diff)
downloadFreeBSD-src-0638a68fdec54d763ffbe77a8375f8c083c3650e.zip
FreeBSD-src-0638a68fdec54d763ffbe77a8375f8c083c3650e.tar.gz
If thread requested to not stop on non-boundary, then not only
stopping signals should obey, but also all forms of single-threading. Otherwise, thread might sleep interruptible while owning some resources, and single-threading thread could try to access them. An example is owning vnode lock while dumping core. Submitted by: Conrad Meyer Review: https://reviews.freebsd.org/D2612 Tested by: pho MFC after: 1 week
-rw-r--r--sys/kern/kern_thread.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index cfcdfc9..0dd5f46 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -868,12 +868,9 @@ thread_suspend_check(int return_instead)
return (ERESTART);
/*
- * Ignore suspend requests for stop signals if they
- * are deferred.
+ * Ignore suspend requests if they are deferred.
*/
- if ((P_SHOULDSTOP(p) == P_STOPPED_SIG ||
- (p->p_flag & P_TOTAL_STOP) != 0) &&
- (td->td_flags & TDF_SBDRY) != 0) {
+ if ((td->td_flags & TDF_SBDRY) != 0) {
KASSERT(return_instead,
("TDF_SBDRY set for unsafe thread_suspend_check"));
return (0);
OpenPOWER on IntegriCloud