From: mvs Date: Mon, 5 Aug 2024 15:43:58 +0000 (+0000) Subject: Unlock most of `kern_vars' variables. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ad534f1885b0eb48a8f96e714aa65dda6684da66;p=openbsd Unlock most of `kern_vars' variables. Add corresponding cases to the kern_sysctl() switch and unlock read-only variables from `kern_vars'. Unlock KERN_SOMAXCONN and KERN_SOMINCONN which are atomically read-only accessed only from solisten(). ok kettenis --- diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 47deb313204..a796cf4df22 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.431 2024/08/05 13:46:16 mvs Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.432 2024/08/05 15:43:58 mvs Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -525,6 +525,30 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, return (sysctl_rdstruct(oldp, oldlenp, newp, &mbs, sizeof(mbs))); } + case KERN_OSREV: + case KERN_NFILES: + case KERN_TTYCOUNT: + case KERN_ARGMAX: + case KERN_POSIX1: + case KERN_NGROUPS: + case KERN_JOB_CONTROL: + case KERN_SAVED_IDS: + case KERN_MAXPARTITIONS: + case KERN_RAWPARTITION: + case KERN_NTHREADS: + case KERN_SOMAXCONN: + case KERN_SOMINCONN: + case KERN_FSYNC: + case KERN_SYSVMSG: + case KERN_SYSVSEM: + case KERN_SYSVSHM: + case KERN_FSCALE: + case KERN_CCPU: + case KERN_NPROCS: + case KERN_NETLIVELOCKS: + case KERN_AUTOCONF_SERIAL: + return (sysctl_bounded_arr(kern_vars, nitems(kern_vars), name, + namelen, oldp, oldlenp, newp, newlen)); } savelen = *oldlenp;