This deals with a mmap+fork bomb that can cause the kernel to
eat all of KVM in vm_map_entry structures. The default limit
should be set generously enough for people using the current
FreeBSD threads incarnation (and isn't an issue w/ linux
threads due to rfork resulting in scaling of the limit for the
shared address space).
Heads up in case a heavy threads programmer sees something I missed.
-Matt
Matthew Dillon
<[EMAIL PROTECTED]>
:dillon 2000/02/16 13:11:37 PST
:
: Modified files:
: sys/kern kern_malloc.c
: sys/sys kernel.h
: sys/vm vm_kern.h vm_map.c vm_mmap.c
: lib/libc/sys mmap.2
: Log:
: Fix null-pointer dereference crash when the system is intentionally
: run out of KVM through a mmap()/fork() bomb that allocates hundreds
: of thousands of vm_map_entry structures.
:
: Add panic to make null-pointer dereference crash a little more verbose.
:
: Add a new sysctl, vm.max_proc_mmap, which specifies the maximum number
: of mmap()'d spaces (discrete vm_map_entry's in the process). The value
: defaults to around 9000 for a 128MB machine. The test is scaled for the
: number of processes sharing a vmspace (aka linux threads). Setting
: the value to 0 disables the feature.
:
: PR: kern/16573
: Approved by: jkh
:
: Revision Changes Path
: 1.64 +3 -2 src/sys/kern/kern_malloc.c
: 1.62 +2 -1 src/sys/sys/kernel.h
: 1.22 +2 -1 src/sys/vm/vm_kern.h
: 1.186 +8 -2 src/sys/vm/vm_map.c
: 1.107 +43 -5 src/sys/vm/vm_mmap.c
: 1.20 +3 -2 src/lib/libc/sys/mmap.2
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message