Since mappings established using __MAP_NOFAIL will be converted into anonymous
authorkettenis <kettenis@openbsd.org>
Wed, 13 Jul 2016 15:57:35 +0000 (15:57 +0000)
committerkettenis <kettenis@openbsd.org>
Wed, 13 Jul 2016 15:57:35 +0000 (15:57 +0000)
commitb4e1c71261ee475034707c9fd945f4bfd49dc371
tree1d2b5db8b754fe206988480463659175e1abe628
parent44223a030b7737a266802e62900aa473de020d41
Since mappings established using __MAP_NOFAIL will be converted into anonymous
memory if the file backing the mapping is truncated, we should check resource
limits.  This prevents callers from triggering a kernel panic and a potential
integer overflow in the amap code by forcing the allocation of too many slots.

Based on an analysis from Jesse Hertz and Tim Newsham.

ok deraadt@
sys/uvm/uvm_mmap.c