summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_mib.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_mib.c')
-rw-r--r--sys/kern/kern_mib.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c
index 58386b3..638d6cb 100644
--- a/sys/kern/kern_mib.c
+++ b/sys/kern/kern_mib.c
@@ -251,13 +251,12 @@ sysctl_kern_securelvl(SYSCTL_HANDLER_ARGS)
/*
* If the process is in jail, return the maximum of the global and
- * local levels; otherwise, return the global level.
+ * local levels; otherwise, return the global level. Perform a
+ * lockless read since the securelevel is an interger.
*/
- if (pr != NULL) {
- mtx_lock(&pr->pr_mtx);
+ if (pr != NULL)
level = imax(securelevel, pr->pr_securelevel);
- mtx_unlock(&pr->pr_mtx);
- } else
+ else
level = securelevel;
error = sysctl_handle_int(oidp, &level, 0, req);
if (error || !req->newptr)
OpenPOWER on IntegriCloud