HomeFreeBSD

vm: Fix anonymous memory clustering under ASLR

Description

vm: Fix anonymous memory clustering under ASLR

By default, our ASLR implementation is supposed to cluster anonymous
memory allocations, unless the application's mmap(..., MAP_ANON, ...)
call included a non-zero address hint. Unfortunately, clustering
never occurred because kern_mmap() always replaced the given address
hint when it was zero. So, the ASLR implementation always believed
that a non-zero hint had been provided and randomized the mapping's
location in the address space. To fix this problem, I'm pushing down
the point at which we convert a hint of zero to the minimum allocatable
address from kern_mmap() to vm_map_find_min().

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D40743

Details

Provenance
alcAuthored on Jun 23 2023, 5:00 PM
Reviewer
kib
Differential Revision
D40743: vm: Fix anonymous memory clustering under ASLR
Parents
rGaf296130eadb: nvme_xpt: Tidy nvme_announce_periph for fabrics support.
Branches
Unknown
Tags
Unknown