svn commit: r240026 - head/sys/kern

Andrey Zonov zont at FreeBSD.org
Mon Sep 3 07:02:39 UTC 2012


On 9/3/12 1:20 AM, Garrett Cooper wrote:
> On Sun, Sep 2, 2012 at 2:16 PM, Garrett Cooper <yanegomi at gmail.com> wrote:
>> On Sun, Sep 2, 2012 at 10:39 AM, Andrey Zonov <zont at 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
> 
> ...
> 
>>
>>     Please add some basic sanity checking to init_param1 -- there's
>> absolutely nothing preventing me from passing in values <= 0 or other
> 
> Correction: values == 0 with little effort (missed the part where it
> was using TUNABLE_ULONG_FETCH). You could get negative values though
> if you overflow the value passed in -- in part because the getenv*
> functions in kern_environment.c don't check for/handle overflow
> gracefully .. I had a patch out for this a while ago that never made
> it in.
> 
>> non-performant (non-multiple of PAGE_SIZE, whacky ratios, etc) values.
>> Thanks,
>> -Garrett

I thought of sanity checking here, but there weren't for tunables and I
did't want to add any "magic numbers" in this code.  I don't think that
we should check for multiple of PAGE_SIZE, may be only for sgrowsiz and
even not checking, just rounding up.

If you have those "magic numbers" I would love to add it.

-- 
Andrey Zonov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 535 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20120903/166246c8/signature.pgp


More information about the svn-src-all mailing list