HomeFreeBSD

Implement shared page address randomization

Description

Implement shared page address randomization

It used to be mapped at the top of the UVA.
If the randomization is enabled any address above .data section will be
randomly chosen and a guard page will be inserted in the shared page
default location.
The shared page is now mapped in exec_map_stack, instead of
exec_new_vmspace. The latter function is called before image activator
has a chance to parse ASLR related flags.
The KERN_PROC_VM_LAYOUT sysctl was extended to provide shared page
address.
The feature is enabled by default for 64 bit applications on all
architectures.
It can be toggled kern.elf64.aslr.shared_page sysctl.

Approved by: mw(mentor)
Sponsored by: Stormshield
Obtained from: Semihalf
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D35349

Details

Provenance
kdAuthored on May 10 2022, 1:22 PM
Reviewer
kib
Differential Revision
D35349: [RFC] Shared page address randomization
Parents
rG361971fbca5f: Rework how shared page related data is stored
Branches
Unknown
Tags
Unknown