aboutsummaryrefslogtreecommitdiff
path: root/compiler-rt
diff options
context:
space:
mode:
authorHans Wennborg <hans@chromium.org>2023-04-13 09:53:06 +0200
committerHans Wennborg <hans@chromium.org>2023-04-13 09:53:06 +0200
commit4a2da7e8a91bd381ee38fbeb6055e7d97453a789 (patch)
tree05cc9ff02ab5fdaeb3777d06a7c0d016de48728c /compiler-rt
parent9d0b55f0e4ca55d04ee8abfdf021913ea3c30082 (diff)
downloadllvm-4a2da7e8a91bd381ee38fbeb6055e7d97453a789.zip
llvm-4a2da7e8a91bd381ee38fbeb6055e7d97453a789.tar.gz
llvm-4a2da7e8a91bd381ee38fbeb6055e7d97453a789.tar.bz2
Revert "ASan: move allocator base to avoid conflict with high-entropy ASLR for x86-64 Linux"
This broke lit tests on Mac, see comment on the code review. > Users have discovered [*] that when CONFIG_ARCH_MMAP_RND_BITS == 32, > it will frequently conflict with ASan's allocator on x86-64 Linux, because the > PIE program segment base address of 0x555555555554 plus an ASLR shift of up to > ((2**32) * 4K == 0x100000000000) will sometimes exceed ASan's hardcoded > base address of 0x600000000000. We fix this by simply moving the allocator base > to 0x500000000000, which is below the PIE program segment base address. This is > cleaner than trying to move it to another location that is sandwiched between > the PIE program and library segments, because if either of those grow too large, > it will collide with the allocator region. > > Note that we will never need to change this base address again (unless we want to increase > the size of the allocator), because ASLR cannot be set above 32-bits for x86-64 Linux (the > PIE program segment and library segments would collide with each other; see also > ARCH_MMAP_RND_BITS_MAX in https://github.com/torvalds/linux/blob/master/arch/x86/Kconfig). > > [*] see https://b.corp.google.com/issues/276925478 > and https://groups.google.com/a/google.com/g/chrome-os-gardeners/c/BbfzCP3dEeo/m/h3C_vVUxCQAJ > > Differential Revision: https://reviews.llvm.org/D147984 This reverts commit 6f42b97a29a5872c115029c615f55f33419a4c1f.
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/lib/asan/asan_allocator.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler-rt/lib/asan/asan_allocator.h b/compiler-rt/lib/asan/asan_allocator.h
index 05dcd2d..0b4dbf0 100644
--- a/compiler-rt/lib/asan/asan_allocator.h
+++ b/compiler-rt/lib/asan/asan_allocator.h
@@ -144,7 +144,7 @@ const uptr kAllocatorSpace = ~(uptr)0;
const uptr kAllocatorSize = 0x8000000000ULL; // 500G
typedef DefaultSizeClassMap SizeClassMap;
# else
-const uptr kAllocatorSpace = 0x500000000000ULL;
+const uptr kAllocatorSpace = 0x600000000000ULL;
const uptr kAllocatorSize = 0x40000000000ULL; // 4T.
typedef DefaultSizeClassMap SizeClassMap;
# endif