This is an old revision of the document!
Address Space Layout Randomization (ASLR)
Support for Address Space Layout Randomization was added in FreeBSD HEAD (13-CURRENT) in base r343964. It is disabled by default.
Architectures
ASLR is enabled on a per-ABI basis, and currently only allowed on FreeBSD native i386 and amd64 (including compat 32bit) ABIs. Support for additional architectures will be added after further testing.
Configuration
Global controls :
- kern.elf{32,64}.aslr.enable - Enable non-fixed mappings done by mmap(2)
- kern.elf{32,64}.aslr.pie_enable - Enable PIE image activation mappings
- kern.elf{32,64}.aslr.honor_sbrk - Allow using sbrk area for mmap(2)
- vm.cluster_anon - Enable anonymous mapping clustering
Per-process and per-image controls:
- procctl(2) adds PROC_ASLR_CTL / PROC_ASLR_STATUS - NT_FREEBSD_FCTL_ASLR_DISABLE feature control note bit makes it possible to force ASLR off for the given binary. A tool to edit the feature control note is in development.