To figure our whether a large allocation can be grown into the
authorguenther <guenther@openbsd.org>
Thu, 30 Jun 2022 17:15:48 +0000 (17:15 +0000)
committerguenther <guenther@openbsd.org>
Thu, 30 Jun 2022 17:15:48 +0000 (17:15 +0000)
commit1c17c7134ac8e8019a4289b160286800252bdda9
tree3456a7d18d8c2313249aaf6c96b8f595b26e8c2c
parent4316e2255bead5cd527ff9e91a162b4e4b95e672
To figure our whether a large allocation can be grown into the
following page(s) we've been first mquery()ing for it, mmapp()ing
w/o MAP_FIXED if available, and then munmap()ing if there was a
race.  Instead, just try it directly with
mmap(MAP_FIXED | __MAP_NOREPLACE)

tested in snaps for weeks

ok deraadt@
lib/libc/stdlib/malloc.c