[PATCH] D35098: [asan] For iOS/AArch64, if the dynamic shadow doesn't fit, restrict the VM space

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 15:51:44 PDT 2017


alekseyshl added inline comments.


================
Comment at: lib/asan/asan_mac.cc:70
+    // Round down to multiplies of 1 MB.
+    uptr new_max_vm = RoundDownTo(largest_gap_found << SHADOW_SCALE, 0x100000);
+    RestrictMemoryToMaxAddress(new_max_vm);
----------------
kubamracek wrote:
> alekseyshl wrote:
> > Why to 1 MB? Is it a Mac requirement?
> Not really, this is purely for convenience and debugging - it's nice to see the memory map nicely aligned.  I can drop this (but we'll still need to round down to at least 8*PAGE_SIZE, maybe more).
No, it's fine, just add a comment that it is arbitrary and purely for the debugging convenience.


================
Comment at: lib/sanitizer_common/sanitizer_common_nolibc.cc:41
+}
+#endif
+
----------------
kubamracek wrote:
> alekseyshl wrote:
> > I wonder what target fails without this definition?
> Actually, it's safestack.a, which uses sanitizer_common, but links in a nolibc mode.
I presume it's RestrictMemoryToMaxAddress what needs MmapFixedNoAccess. How about moving it into sanitizer_mac_libcdep.cc?


https://reviews.llvm.org/D35098





More information about the llvm-commits mailing list