Differential D35055 Diff 105398 contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
Changeset View
Changeset View
Standalone View
Standalone View
contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
Show First 20 Lines • Show All 2,202 Lines • ▼ Show 20 Lines | #elif SANITIZER_FREEBSD | ||||
int aslr_status; | int aslr_status; | ||||
if (UNLIKELY(procctl(P_PID, 0, PROC_ASLR_STATUS, &aslr_status) == -1)) { | if (UNLIKELY(procctl(P_PID, 0, PROC_ASLR_STATUS, &aslr_status) == -1)) { | ||||
// We're making things less 'dramatic' here since | // We're making things less 'dramatic' here since | ||||
// the cmd is not necessarily guaranteed to be here | // the cmd is not necessarily guaranteed to be here | ||||
// just yet regarding FreeBSD release | // just yet regarding FreeBSD release | ||||
return; | return; | ||||
} | } | ||||
if ((aslr_status & PROC_ASLR_ACTIVE) != 0) { | if ((aslr_status & PROC_ASLR_ACTIVE) != 0) { | ||||
Printf("This sanitizer is not compatible with enabled ASLR " | VReport(1, "This sanitizer is not compatible with enabled ASLR " | ||||
"and binaries compiled with PIE\n" | "and binaries compiled with PIE\n" | ||||
"ASLR will be disabled and the program re-executed.\n"); | "ASLR will be disabled and the program re-executed.\n"); | ||||
int aslr_ctl = PROC_ASLR_FORCE_DISABLE; | int aslr_ctl = PROC_ASLR_FORCE_DISABLE; | ||||
CHECK_NE(procctl(P_PID, 0, PROC_ASLR_CTL, &aslr_ctl), -1); | CHECK_NE(procctl(P_PID, 0, PROC_ASLR_CTL, &aslr_ctl), -1); | ||||
ReExec(); | ReExec(); | ||||
} | } | ||||
#else | #else | ||||
// Do nothing | // Do nothing | ||||
#endif | #endif | ||||
} | } | ||||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |