[compiler-rt] [msan] Re-exec with no ASLR if memory layout is incompatible on Linux (PR #85142)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 15:49:03 PDT 2024


================
@@ -106,7 +107,8 @@ const MappingDesc kMemoryLayout[] = {
     {0x510000000000ULL, 0x600000000000ULL, MappingDesc::APP, "app-2"},
     {0x600000000000ULL, 0x610000000000ULL, MappingDesc::ORIGIN, "origin-1"},
     {0x610000000000ULL, 0x700000000000ULL, MappingDesc::INVALID, "invalid"},
-    {0x700000000000ULL, 0x800000000000ULL, MappingDesc::APP, "app-3"}};
+    {0x700000000000ULL, 0x740000000000ULL, MappingDesc::ALLOCATOR, "allocator"},
----------------
thurstond wrote:

InitShadow is called before the allocator is initialized, so we need a way to tell InitShadow that we want to check that the allocator memory range is available (but not map it, because the allocator will do that).

The existing enum values don't suffice:
- MappingDesc::APP does not call CheckMemoryRangeAvailability()
- MappingDesc::INVALID does call CheckMemoryRangeAvailability(), but it will also be protected, which we don't want
- MappingDesc::SHADOW also calls CheckMemoryRangeAvailability(), but it will map the memory, which we also don't want
- MappingDesc::ALLOCATOR will call CheckMemoryRangeAvailability() but will not map or protect the memory

https://github.com/llvm/llvm-project/pull/85142


More information about the llvm-commits mailing list