summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2000-02-16 21:11:33 +0000
committerdillon <dillon@FreeBSD.org>2000-02-16 21:11:33 +0000
commit7a2987cf9410d129917e89db27af78911bd0fb60 (patch)
treee9fa93a9df696f57e919e1e8f97b841d07227b0b /lib/libc
parente8cfdc976f1f31ae86f30a656797e2820c9f439b (diff)
downloadFreeBSD-src-7a2987cf9410d129917e89db27af78911bd0fb60.zip
FreeBSD-src-7a2987cf9410d129917e89db27af78911bd0fb60.tar.gz
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
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/sys/mmap.23
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/sys/mmap.2 b/lib/libc/sys/mmap.2
index 1906e53..433f8b7 100644
--- a/lib/libc/sys/mmap.2
+++ b/lib/libc/sys/mmap.2
@@ -253,7 +253,8 @@ was not page-aligned. (See BUGS below.)
.Dv MAP_FIXED
was specified and the
.Fa addr
-parameter wasn't available.
+parameter wasn't available, or the system has reached the per-process mmap
+limit specified in the vm.max_proc_mmap sysctl.
.Dv MAP_ANON
was specified and insufficient memory was available.
.Sh "SEE ALSO"
OpenPOWER on IntegriCloud