HomeFreeBSD

compiler-rt: avoid segfaults when re-exec'ing with ASLR

Description

compiler-rt: avoid segfaults when re-exec'ing with ASLR

The ReExec() function that re-executes the binary after
turning off ASLR should not call elf_aux_info(3) and realpath(3), since
these will also be intercepted. Instead, loop directly over the elf aux
info vector to find the executable path, and avoid calling realpath(3)
since it is actually unwanted for this use case.

Fixes: 930a7c2ac67e, 96fe7c8ab0f6

(cherry picked from commit 4c9a0adad18263ec8725d9bfc5f560c6ad1da8bd)
(cherry picked from commit 7c25a53a2cb975e516cfea78898bfb850db88524)

Note: This is a partial cherry-pick, as only the ReExec change from the
original applies to FreeBSD 13.2.

Security: EN-23:15.sanitizer
Approved by: so

Details

Provenance
dimAuthored on Nov 22 2023, 6:23 PM
emasteCommitted on Dec 5 2023, 6:20 PM
Parents
rG08225c10315a: Add UPDATING entries and bump version.
Branches
Unknown
Tags
Unknown