[PATCH] D83247: [compiler-rt][asan][hwasan] Refactor shadow setup into sanitizer_common (NFCI)

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 05:45:56 PDT 2020


vitalybuka added inline comments.


================
Comment at: compiler-rt/lib/hwasan/hwasan_mapping.h:43
+constexpr uptr kZeroBaseShadowStart = 0;
+constexpr uptr kZeroBaseMaxShadowStart = 1 << 18;
+
----------------
Why do we need them in the header? I don't see these constants used outside hwasan_linux.
If this is to pass kHighMemEnd into high_mem_end, then we can make it optional
uptr* high_mem_end = null


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_common.h:126
+// granularity and shadow size.
+uptr GetHighMemEnd(uptr shadow_scale);
+
----------------
Could you please keep this one in asan/hwasan for now.
It looks like a random mem-region related code  moved here when the rest is still there.



================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_common.h:135
+uptr MapDynamicShadow(uptr shadow_size_bytes, uptr shadow_scale,
+                      uptr &high_mem_end, uptr min_shadow_base_alignment = 0);
+
----------------
and maybe drop default 0 and make out argument the last one?

Also high_mem_end in this interface looks unrelated. Maybe mapped shadow size? Better to land as is and followup later.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83247/new/

https://reviews.llvm.org/D83247





More information about the llvm-commits mailing list