From owner-freebsd-current@FreeBSD.ORG Wed Nov 28 17:17:38 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 616CE16A418 for ; Wed, 28 Nov 2007 17:17:38 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 1822313C46E for ; Wed, 28 Nov 2007 17:17:38 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id C5A2166A572 for ; Wed, 28 Nov 2007 17:57:45 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yF+83VOj4TVA for ; Wed, 28 Nov 2007 17:57:44 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 1D86166A55D for ; Wed, 28 Nov 2007 17:57:44 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.13.8/8.13.8/Submit) id lASGvhQO040321 for current@freebsd.org; Wed, 28 Nov 2007 17:57:43 +0100 (CET) (envelope-from rdivacky) Date: Wed, 28 Nov 2007 17:57:43 +0100 From: Roman Divacky To: current@freebsd.org Message-ID: <20071128165743.GA40240@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: patch to make maxssiz/maxdsiz/maxtsiz RW sysctls X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2007 17:17:38 -0000 --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable hi http://www.vlakno.cz/~rdivacky/sizes_sysctl.patch this makes kern.max[dst]siz RW sysctls. please test this (seems to work ok for me), here is an explanation/commit message: Change a bunch of RD-only sysctls dealing with sizes of data/stack/text segments into RW. maxtsiz - maximal allowed size of the code segment, used only for checking= =20 when loading various executable files (imgact_* files) maxdsiz - maximal data segment size, set as a maximum for rlimit (rlim_max) also a runtime check in kern_setrlimit. maxssiz - maximal stack size, used for rlimit stuff. it is used to set up t= he default vm map of the stack in exec_new_vmspace sgrowsiz - amount of memory the stack grows of. =20 All of these are used during runtime and can be changed safely via sysctl. = Some paradoxes can be seen like when a process inherits [tds]siz of the default = size then root changes sysctl of the max[tds]siz to lower value and the process calls setrlimit to maximal size which is lower than the default one. All the sysctls handlers runtime check sanity of the argument passed in. please report back so this can be commited thnx, roman --5mCyUwZo2JvN/JJP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHTZ4HLVEj6D3CBEwRArL+AJ4krUKoGUxlkjsALv2EUSVQAOuTWwCfYfny enRen+5sovWbY3jgyaU9JLQ= =EUZh -----END PGP SIGNATURE----- --5mCyUwZo2JvN/JJP--