patch to make maxssiz/maxdsiz/maxtsiz RW sysctls

From: Roman Divacky <rdivacky_at_freebsd.org>
Date: Wed, 28 Nov 2007 17:57:43 +0100
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 
	  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 the
	  default vm map of the stack in exec_new_vmspace

sgrowsiz - amount of memory the stack grows of.
	  
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

Received on Wed Nov 28 2007 - 16:17:38 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:23 UTC