summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-31 02:46:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-31 02:46:24 +0000
commitc556799c831722ab660b309fcbd0bd41788eacda (patch)
tree2545c9cad38e3d0d8fa66f8fcbc92e5b6a186468 /sys
parent3f1eabf9e8612e30b802b38d2c784ada95b4582b (diff)
expose the sysctl backing getloadavg(3) all the time, now that more
consumers have been found. Spotted by Nathanael Rensen
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_pledge.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c
index 6a8cf66262d..5b78155f453 100644
--- a/sys/kern/kern_pledge.c
+++ b/sys/kern/kern_pledge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_pledge.c,v 1.92 2015/10/29 15:04:54 deraadt Exp $ */
+/* $OpenBSD: kern_pledge.c,v 1.93 2015/10/31 02:46:23 deraadt Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -927,9 +927,6 @@ pledge_sysctl_check(struct proc *p, int miblen, int *mib, void *new)
if (miblen == 2 && /* kern.consdev */
mib[0] == CTL_KERN && mib[1] == KERN_CONSDEV)
return (0);
- if (miblen == 2 && /* kern.loadavg */
- mib[0] == CTL_VM && mib[1] == VM_LOADAVG)
- return (0);
if (miblen == 2 && /* kern.cptime */
mib[0] == CTL_KERN && mib[1] == KERN_CPTIME)
return (0);
@@ -1020,6 +1017,9 @@ pledge_sysctl_check(struct proc *p, int miblen, int *mib, void *new)
if (miblen == 2 && /* hw.ncpu */
mib[0] == CTL_HW && mib[1] == HW_NCPU)
return (0);
+ if (miblen == 2 && /* kern.loadavg / getloadavg(3) */
+ mib[0] == CTL_VM && mib[1] == VM_LOADAVG)
+ return (0);
printf("%s(%d): sysctl %d: %d %d %d %d %d %d\n",
p->p_comm, p->p_pid, miblen, mib[0], mib[1],