summaryrefslogtreecommitdiff
path: root/sys/kern/kern_ktrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_ktrace.c')
-rw-r--r--sys/kern/kern_ktrace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c
index 75372d8aa9f4..c66108ff9947 100644
--- a/sys/kern/kern_ktrace.c
+++ b/sys/kern/kern_ktrace.c
@@ -181,6 +181,8 @@ ktrgenio(vp, fd, rw, uio, error)
if (error)
return;
+
+ mtx_lock(&Giant);
/*
* don't let p_tracep get ripped out from under us
*/
@@ -200,6 +202,7 @@ ktrgenio(vp, fd, rw, uio, error)
vrele(vp);
FREE(kth, M_KTRACE);
p->p_traceflag &= ~KTRFAC_ACTIVE;
+ mtx_unlock(&Giant);
}
void