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.

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.

Global controls :

  • kern.elf{32,64}.aslr.enable - Enable address map randomization (Default: 0)
  • kern.elf{32,64}.aslr.pie_enable - Enable ASLR for Position-Independent Executables (PIE) binaries (Default: 0)
  • kern.elf{32,64}.aslr.honor_sbrk - Assume sbrk is used (Default: 1)
  • vm.cluster_anon - Cluster anonymous mappings (Default: 1)

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.
  • addressspacelayoutrandomization.1549855410.txt.gz
  • Last modified: 2019/02/11 03:23
  • by KubilayKocak