Bug 15860

Summary: patch to make default kern.maxfilesperproc < kern.maxfiles
Product: Base System Reporter: kbyanc <kbyanc>
Component: kernAssignee: kbyanc
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.2-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description kbyanc 2000-01-03 17:00:01 UTC
	Kern.maxfilesperproc defaults to the same value as kern.maxfiles
	(MAXFILES in sys/conf/param.c). However, as noted in multiple
	threads on the -hackers mailing list this behaviour can cause a
	rogue process to runaway without root being able to kill it.
	Admittingly, this is purely the admin's fault for not setting
	limits, but there is no good reason to have the system default to
	a state that allows this to occur.

Fix: The simple patch below reduces the maxfilesperproc to initially be
	less than maxfiles. The number 20 was more or less pulled out of
	thin air and feel free to adjust it, so long as the change gets
	made. I picked twenty simply because it is less than the minimum
	value of MAXFILES (which is 2*NPROC which is 72 when MAXUSERS is
	1) and should be enough for root to login and run ps/kill.

		- Kelly
Comment 1 dd freebsd_committer freebsd_triage 2001-07-22 16:24:28 UTC
Responsible Changed
From-To: freebsd-bugs->kbyanc

over to originator
Comment 2 kbyanc freebsd_committer freebsd_triage 2001-12-13 21:24:46 UTC
State Changed
From-To: open->closed

Obsoleted by rev 1.48 of src/sys/kern/subr_param.c: 
Limit maxprocperuid to 9/10 maxproc, and limit maxfilesperproc to 
9/10 maxfiles.  This should make local resource exhaustion attacks 
to handle with a non-tweaked setup.