rw sysctl data/stack/text segmentu

Roman Divacky rdivacky at freebsd.org
Sun Nov 25 13:01:13 CET 2007


pred par dny tu probihala debata tusim o to ze by melo jit
nastavit veci z $subj za behu atak..

sem se konecne dokopal to napsat... nemam cas ani naladu to testovat
(velmi narocny vikend ;) ) a tak prosim aby to nekdo otestil za mne :)


patchidlo proti 8-current je tady: www.vlakno.cz/~rdivacky/sizes_sysctl.patch

kdyztak na ten patch nekdo mrknete jestli ty min/max hodnoty co jsem tam dal
davaji aspon trocha smysl, ja se v tom vubec nevyznam :)

pokud nekoho zajima commit message, tak jsem splodil todlencto:

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.

toz diky moc a fakt to nekdo testnete at se to da commitnout (mozna jsme schopni
i zaridit rychlej MFC do 7.0R)

roman



More information about the Users-l mailing list