Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Sep 2012 14:16:10 -0700
From:      Garrett Cooper <yanegomi@gmail.com>
To:        Andrey Zonov <zont@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r240026 - head/sys/kern
Message-ID:  <CAGH67wSqqXdC3LiLYsebMC88Kt=H5Hu_MJRR2Ug1zjMS3Et%2BYQ@mail.gmail.com>
In-Reply-To: <201209021739.q82Hd3CE042578@svn.freebsd.org>
References:  <201209021739.q82Hd3CE042578@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Sep 2, 2012 at 10:39 AM, Andrey Zonov <zont@freebsd.org> wrote:
> Author: zont
> Date: Sun Sep  2 17:39:02 2012
> New Revision: 240026
> URL: http://svn.freebsd.org/changeset/base/240026
>
> Log:
>   - Make kern.maxtsiz, kern.dfldsiz, kern.maxdsiz, kern.dflssiz, kern.maxssiz
>     and kern.sgrowsiz sysctls writable.
>
>   Approved by:  kib (mentor)
>
> Modified:
>   head/sys/kern/subr_param.c
>
> Modified: head/sys/kern/subr_param.c
> ==============================================================================
> --- head/sys/kern/subr_param.c  Sun Sep  2 15:27:20 2012        (r240025)
> +++ head/sys/kern/subr_param.c  Sun Sep  2 17:39:02 2012        (r240026)
> @@ -119,18 +119,18 @@ SYSCTL_LONG(_kern, OID_AUTO, maxswzone,
>      "Maximum memory for swap metadata");
>  SYSCTL_LONG(_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN, &maxbcache, 0,
>      "Maximum value of vfs.maxbufspace");
> -SYSCTL_ULONG(_kern, OID_AUTO, maxtsiz, CTLFLAG_RDTUN, &maxtsiz, 0,
> +SYSCTL_ULONG(_kern, OID_AUTO, maxtsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &maxtsiz, 0,
>      "Maximum text size");
> -SYSCTL_ULONG(_kern, OID_AUTO, dfldsiz, CTLFLAG_RDTUN, &dfldsiz, 0,
> +SYSCTL_ULONG(_kern, OID_AUTO, dfldsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &dfldsiz, 0,
>      "Initial data size limit");
> -SYSCTL_ULONG(_kern, OID_AUTO, maxdsiz, CTLFLAG_RDTUN, &maxdsiz, 0,
> +SYSCTL_ULONG(_kern, OID_AUTO, maxdsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &maxdsiz, 0,
>      "Maximum data size");
> -SYSCTL_ULONG(_kern, OID_AUTO, dflssiz, CTLFLAG_RDTUN, &dflssiz, 0,
> +SYSCTL_ULONG(_kern, OID_AUTO, dflssiz, CTLFLAG_RDTUN | CTLFLAG_RW, &dflssiz, 0,
>      "Initial stack size limit");
> -SYSCTL_ULONG(_kern, OID_AUTO, maxssiz, CTLFLAG_RDTUN, &maxssiz, 0,
> +SYSCTL_ULONG(_kern, OID_AUTO, maxssiz, CTLFLAG_RDTUN | CTLFLAG_RW, &maxssiz, 0,
>      "Maximum stack size");
> -SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RDTUN, &sgrowsiz, 0,
> -    "Amount to grow stack on a stack fault");
> +SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &sgrowsiz,
> +    0, "Amount to grow stack on a stack fault");
>  SYSCTL_PROC(_kern, OID_AUTO, vm_guest, CTLFLAG_RD | CTLTYPE_STRING,
>      NULL, 0, sysctl_kern_vm_guest, "A",
>      "Virtual machine guest detected? (none|generic|xen)");

    Please add some basic sanity checking to init_param1 -- there's
absolutely nothing preventing me from passing in values <= 0 or other
non-performant (non-multiple of PAGE_SIZE, whacky ratios, etc) values.
Thanks,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGH67wSqqXdC3LiLYsebMC88Kt=H5Hu_MJRR2Ug1zjMS3Et%2BYQ>