summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-08-07 13:58:13 +0000
committerjhb <jhb@FreeBSD.org>2003-08-07 13:58:13 +0000
commit12f44bde5dc9d7f8825e07548b2811c1de0d4c0c (patch)
tree743ec5fbe8fb3ee0ca0b266301e4285e56d9c712 /sys
parentc47985e350989a08effa9ee72e9aa7c100d8d407 (diff)
downloadFreeBSD-src-12f44bde5dc9d7f8825e07548b2811c1de0d4c0c.zip
FreeBSD-src-12f44bde5dc9d7f8825e07548b2811c1de0d4c0c.tar.gz
The ktrace mutex does not need to be locked around the post of the ktrace
semaphore and doing so can lead to a possible reversal. WITNESS would have caught this if semaphores were used more often in the kernel. Submitted by: Ted Unangst <tedu@stanford.edu>, Dawson Engler
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_ktrace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c
index a6630f2..ded99e9 100644
--- a/sys/kern/kern_ktrace.c
+++ b/sys/kern/kern_ktrace.c
@@ -261,8 +261,8 @@ ktr_submitrequest(struct ktr_request *req)
mtx_lock(&ktrace_mtx);
STAILQ_INSERT_TAIL(&ktr_todo, req, ktr_list);
- sema_post(&ktrace_sema);
mtx_unlock(&ktrace_mtx);
+ sema_post(&ktrace_sema);
curthread->td_pflags &= ~TDP_INKTRACE;
}
OpenPOWER on IntegriCloud