File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -114,8 +114,12 @@ void ReExecWithoutASLR() {
114114 // this function as a last resort (when the memory mapping is incompatible
115115 // and ASan would fail anyway).
116116 int old_personality = personality (0xffffffff );
117- bool aslr_on =
118- (old_personality != -1 ) && ((old_personality & ADDR_NO_RANDOMIZE) == 0 );
117+ if (old_personality == -1 ) {
118+ VReport (1 , " WARNING: unable to run personality check.\n " );
119+ return ;
120+ }
121+
122+ bool aslr_on = ((old_personality & ADDR_NO_RANDOMIZE) == 0 );
119123
120124 if (aslr_on) {
121125 // Disable ASLR if the memory layout was incompatible.
Original file line number Diff line number Diff line change @@ -109,14 +109,12 @@ void InitializeShadowMemory() {
109109 ProtectGap (kShadowGap2Beg , kShadowGap2End - kShadowGap2Beg + 1 );
110110 ProtectGap (kShadowGap3Beg , kShadowGap3End - kShadowGap3Beg + 1 );
111111 } else {
112- # if SANITIZER_LINUX
113112 // The shadow mappings can shadow the entire user address space. However,
114113 // on 32-bit systems, the maximum ASLR entropy (currently up to 16-bits
115114 // == 256MB) is a significant chunk of the address space; reclaiming it by
116115 // disabling ASLR might allow chonky binaries to run.
117116 if (sizeof (uptr) == 32 )
118117 TryReExecWithoutASLR ();
119- # endif
120118
121119 Report (
122120 " Shadow memory range interleaves with an existing memory mapping. "
Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ uptr __asan_get_shadow_memory_dynamic_address() {
4343 __asan_init ();
4444 return __asan_shadow_memory_dynamic_address;
4545}
46-
4746} // extern "C"
4847
4948// ---------------------- Windows-specific interceptors ---------------- {{{
You can’t perform that action at this time.
0 commit comments