summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_thread.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2013-03-21 14:06:27 +0000
committerjhb <jhb@FreeBSD.org>2013-03-21 14:06:27 +0000
commit1b6f4e466c45e64ecf16c2a0e2e931f5861b11bd (patch)
treeb092b5e06cc6203f2835efa36b0136ddabdce1b8 /sys/kern/kern_thread.c
parent0487ef2754a1634d4a11098002923f70f5b863ba (diff)
downloadFreeBSD-src-1b6f4e466c45e64ecf16c2a0e2e931f5861b11bd.zip
FreeBSD-src-1b6f4e466c45e64ecf16c2a0e2e931f5861b11bd.tar.gz
Another NFS SIGSTOP related fix: Ignore thread suspend requests due to
SIGSTOP if stop signals are currently deferred. This can occur if a process is stopped via SIGSTOP while a thread is running or runnable but before it has set TDF_SBDRY. Tested by: pho Reviewed by: kib MFC after: 1 week
Diffstat (limited to 'sys/kern/kern_thread.c')
-rw-r--r--sys/kern/kern_thread.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 4f0266b..5da4866 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -795,6 +795,17 @@ thread_suspend_check(int 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.
* Assumes that P_SINGLE_EXIT implies P_STOPPED_SINGLE.
OpenPOWER on IntegriCloud