]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Implement shared page address randomization
authorKornel Dulęba <kd@FreeBSD.org>
Tue, 10 May 2022 13:22:55 +0000 (15:22 +0200)
committerKornel Dulęba <kd@FreeBSD.org>
Mon, 18 Jul 2022 14:27:37 +0000 (16:27 +0200)
commit939f0b6323e0a17349aa5e766eacfd0a138cfcc1
tree9542e4fa070001e29e1e22de9e1123a959e64012
parent361971fbca5fdb8121dd4d05119d81269af78ea7
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
sys/compat/freebsd32/freebsd32.h
sys/kern/imgact_elf.c
sys/kern/kern_exec.c
sys/kern/kern_proc.c
sys/sys/imgact.h
sys/sys/user.h
tests/sys/kern/kern_copyin.c