Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Nov 2007 17:57:43 +0100
From:      Roman Divacky <rdivacky@freebsd.org>
To:        current@freebsd.org
Subject:   patch to make maxssiz/maxdsiz/maxtsiz RW sysctls
Message-ID:  <20071128165743.GA40240@freebsd.org>

next in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071128165743.GA40240>