mirror of
https://github.com/opnsense/src.git
synced 2026-06-06 23:32:52 -04:00
compiler-rt: re-exec with ASLR disabled when necessary
Some sanitizers (at least msan) currently require ASLR to be disabled. When we detect that ASLR is enabled, re-exec with it disabled rather than exiting with an error. See LLVM GitHub issue 53256 for more detail: https://github.com/llvm/llvm-project/issues/53256 No objection: dim MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33934
This commit is contained in:
parent
96fe7c8ab0
commit
930a7c2ac6
1 changed files with 5 additions and 2 deletions
|
|
@ -2197,8 +2197,11 @@ void CheckASLR() {
|
|||
}
|
||||
if ((aslr_status & PROC_ASLR_ACTIVE) != 0) {
|
||||
Printf("This sanitizer is not compatible with enabled ASLR "
|
||||
"and binaries compiled with PIE\n");
|
||||
Die();
|
||||
"and binaries compiled with PIE\n"
|
||||
"ASLR will be disabled and the program re-executed.\n");
|
||||
int aslr_ctl = PROC_ASLR_FORCE_DISABLE;
|
||||
CHECK_NE(procctl(P_PID, 0, PROC_ASLR_CTL, &aslr_ctl), -1);
|
||||
ReExec();
|
||||
}
|
||||
#else
|
||||
// Do nothing
|
||||
|
|
|
|||
Loading…
Reference in a new issue