Unverified Commit 7440e4ed authored by Dimitry Andric's avatar Dimitry Andric Committed by GitHub
Browse files

[sanitizer] Add re-execution on FreeBSD when ASLR is detected (#73439)

In the FreeBSD base system, re-executing the main binary when ASLR is
detected was implemented in the following commits:

* freebsd/freebsd-src@7cafe89f9ce33
* freebsd/freebsd-src@96fe7c8ab0f65
* freebsd/freebsd-src@930a7c2ac67e1
* freebsd/freebsd-src@0a736f0a6aeb0
* freebsd/freebsd-src@4c9a0adad1826

Squash all these to bring them into upstream compiler-rt.

When ASLR is detected to be enabled, this first force-disables ASLR for
the current process, then calls ReExec(). The ReExec() function gets a
FreeBSD specific implementation for finding the path of the executed
program, via the ELF auxiliary vector. This is done without calling into
the regular elf_aux_info(3) function, as that makes use of several
already-intercepted functions.
parent a0a1ff3a
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment