Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions compiler-rt/lib/asan/asan_shadow_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,14 @@ void InitializeShadowMemory() {
ProtectGap(kShadowGap2Beg, kShadowGap2End - kShadowGap2Beg + 1);
ProtectGap(kShadowGap3Beg, kShadowGap3End - kShadowGap3Beg + 1);
} else {
// The shadow mappings can shadow the entire user address space. However,
// on 32-bit systems, the maximum ASLR entropy (currently up to 16-bits
// == 256MB) is a significant chunk of the address space; reclaiming it by
// disabling ASLR might allow chonky binaries to run.
if (sizeof(uptr) == 32)
TryReExecWithoutASLR();
// ASan's mappings can usually shadow the entire address space, even with
// maximum ASLR entropy. However:
// - On 32-bit systems, the maximum ASLR entropy (currently up to 16-bits
// == 256MB) is a significant chunk of the address space; reclaiming it
// by disabling ASLR might allow chonky binaries to run.
// - On 64-bit systems, some settings (e.g., for Linux, unlimited stack
// size plus 31+ bits of entropy) can lead to an incompatible layout.
TryReExecWithoutASLR();

Report(
"Shadow memory range interleaves with an existing memory mapping. "
Expand Down