ASAN: reduce verbosity

When running binaries compiled with libasan in PIE and with ALSR on,
the previous code always print the WARNING message, the new code only
printed it if the run is made with the right verbosity

Before this change, many unit test will always fail because of the extra
message which is printed

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D35055
MFC after:	2 weeks
This commit is contained in:
Baptiste Daroussin 2022-04-25 11:23:23 +02:00
parent efb8f0b8db
commit 0a736f0a6a

View File

@ -2208,9 +2208,9 @@ void CheckASLR() {
return;
}
if ((aslr_status & PROC_ASLR_ACTIVE) != 0) {
Printf("This sanitizer is not compatible with enabled ASLR "
"and binaries compiled with PIE\n"
"ASLR will be disabled and the program re-executed.\n");
VReport(1, "This sanitizer is not compatible with enabled ASLR "
"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();