HomeFreeBSD

posixshm largepage_mmap: fix a racy test

Description

posixshm largepage_mmap: fix a racy test

You can't ever safely map a single page and then map a superpage sized
mapping over it with MAP_FIXED. Even in a single-threaded program, ASLR
might mean you land too close to another mapping and on CheriBSD we
don't allow the initial reservation to grow because doing so requires
program changes that are hard to automate.

To avoid this, map the entire region we want to use upfront.

Reviewed by: markj
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D43282

Details

Provenance
brooksAuthored on Jan 3 2024, 4:39 PM
Reviewer
markj
Differential Revision
D43282: posixshm largepage_mmap: fix a racy test
Parents
rG85c9d36497fc: acl_equiv_mode_np: zero mode on just inited ACL
Branches
Unknown
Tags
Unknown