summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_kse.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2004-03-01 23:07:58 +0000
committerjhb <jhb@FreeBSD.org>2004-03-01 23:07:58 +0000
commit86e3aa5b6c69390ce4972f6a9224da23e77a9266 (patch)
tree03b858e67f4fefdfdcb2616f9fc2292d07d8d9aa /sys/kern/kern_kse.c
parent1dc1bc80102e5c20bbe1162f72ab39947bde1ca4 (diff)
downloadFreeBSD-src-86e3aa5b6c69390ce4972f6a9224da23e77a9266.zip
FreeBSD-src-86e3aa5b6c69390ce4972f6a9224da23e77a9266.tar.gz
Check for TDF_SINTR before calling sleepq_abort() as there is a narrow
race in between sleepq_add() and sleepq_catch_signals() in that setting td_wchan and TDF_SINTR is not atomic to sched_lock but only to the sleepq lock. This band-aid will stop assertion failures, but there is perhaps a larger problem with the sleepq_add/sleepq_catch_signals race that I am not sure how to solve. For the signals case the race is harmless because we always call cursig() after setting TDF_SINTR. However, KSE doesn't do anything in sleepq_catch_signals() to check that this race was lost, so I am unsure if this race is harmful for this specific abort.
Diffstat (limited to 'sys/kern/kern_kse.c')
-rw-r--r--sys/kern/kern_kse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c
index cb46e9d..037266a 100644
--- a/sys/kern/kern_kse.c
+++ b/sys/kern/kern_kse.c
@@ -643,7 +643,7 @@ kse_wakeup(struct thread *td, struct kse_wakeup_args *uap)
if (ku) {
if ((td2 = ku->ku_owner) == NULL) {
panic("%s: no owner", __func__);
- } else if (TD_ON_SLEEPQ(td2) &&
+ } else if (TD_ON_SLEEPQ(td2) && (td2->td_flags & TDF_SINTR) &&
((td2->td_wchan == &kg->kg_completed) ||
(td2->td_wchan == &p->p_siglist &&
(ku->ku_mflags & KMF_WAITSIGEVENT)))) {
OpenPOWER on IntegriCloud