From owner-svn-src-all@FreeBSD.ORG Mon Sep 3 07:02:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BFC4F1065691 for ; Mon, 3 Sep 2012 07:02:39 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 24A588FC1D for ; Mon, 3 Sep 2012 07:02:38 +0000 (UTC) Received: by lbbgg13 with SMTP id gg13so2826421lbb.13 for ; Mon, 03 Sep 2012 00:02:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=oX0L5tNG7IAzgeAIJkL2J9me8i7Wn1CkYVegx6TxtBc=; b=OJSniWCKuZ6vi12NnseX232aYwBvB7g3FGOPupXup96QSFPUl98c/n2p8hMleSukI+ tHlVI8P6EpDq2+bVn+LcCCNF1icnOhwlFd2cGkgzMCHAmoxXNxpG01dewI+TKXOHOgqc /sjhfYkPdbAyhGKdU4LpJiIM9SQ+FaLzR9lKwGnfYMuopDS8fLTmK+pAQgBk4ZeGo513 zvbXqWt04yyV5AWZz/2ISE1rofWq8NqCmK+AqRmHRfewLPOlGH/89I5RiVRXx+Wu5MIO 4o1/SJtFvT8qzh+mRA9mwylP2K2842N4kyvnQZeu+CGSsP/bGyou73PwYptKzz/q4hu3 BM7Q== Received: by 10.112.103.167 with SMTP id fx7mr2508969lbb.44.1346655757724; Mon, 03 Sep 2012 00:02:37 -0700 (PDT) Received: from zont-osx.local (ppp95-165-143-86.pppoe.spdop.ru. [95.165.143.86]) by mx.google.com with ESMTPS id hg4sm12659134lab.11.2012.09.03.00.02.36 (version=SSLv3 cipher=OTHER); Mon, 03 Sep 2012 00:02:36 -0700 (PDT) Sender: Andrey Zonov Message-ID: <50445609.8070902@FreeBSD.org> Date: Mon, 03 Sep 2012 11:02:33 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: Garrett Cooper References: <201209021739.q82Hd3CE042578@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.4.4 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig1DE189EBF5C3297B1F032688" X-Gm-Message-State: ALoCoQkb9ERSqwbgqNQrNQtFAIuRDZ8tPhuCyJ7i+o0xKqyrpNgGFRuYvnkoLyViWamZhwWefy2n Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240026 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 07:02:39 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig1DE189EBF5C3297B1F032688 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 9/3/12 1:20 AM, Garrett Cooper wrote: > On Sun, Sep 2, 2012 at 2:16 PM, Garrett Cooper wro= te: >> On Sun, Sep 2, 2012 at 10:39 AM, Andrey Zonov 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= =2Emaxssiz >>> and kern.sgrowsiz sysctls writable. >>> >>> Approved by: kib (mentor) >>> >>> Modified: >>> head/sys/kern/subr_param.c >=20 > ... >=20 >> >> Please add some basic sanity checking to init_param1 -- there's >> absolutely nothing preventing me from passing in values <=3D 0 or othe= r >=20 > Correction: values =3D=3D 0 with little effort (missed the part where i= t > 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. >=20 >> 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. --=20 Andrey Zonov --------------enig1DE189EBF5C3297B1F032688 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJQRFYLAAoJEBWLemxX/CvT6WAH/RjhZHIPQpHNIMa0hu7i1K6e 5DVNt1MmnBEomlRDYXHKIrYrAienvaoqyyXKjYVVGm3Vmw3Hs6rwNEg+aP2SbF1U mTDqHJdViWoil1K2EjAGMtnRleBUkDe+XyjHKLgyf+gu60br1O09ND77GdVxj0nh cP8SenPUoQs/V+4DEn8Sn9oZDdq3LZQgntJGaxPUs1dfGrDBCdsk4yWUE0blD+f+ Du3kkKUwBh9iJ0cLX46hgYcRhVNBCxejjsPUqpJxbW0QBML3FEejbXtx0bUlETpu pk27Y837KBQETt9ODja5rcF1fw1kGaSLnmkPBr30qaZSYf/wdrRIz2OYHrGk81E= =eRXG -----END PGP SIGNATURE----- --------------enig1DE189EBF5C3297B1F032688--