aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2024-07-11 17:39:15 -0700
committerVitaly Buka <vitalybuka@google.com>2024-07-11 17:55:54 -0700
commitdb3d3378ba751337c12147d11367006f23becc0c (patch)
treef907daa3e7915c96bbbcfe3e4af87b70c6fcfd41
parentce2b28055330b37e67ece18bd42d13beb537955d (diff)
downloadllvm-db3d3378ba751337c12147d11367006f23becc0c.zip
llvm-db3d3378ba751337c12147d11367006f23becc0c.tar.gz
llvm-db3d3378ba751337c12147d11367006f23becc0c.tar.bz2
[NFC][hwasan] Print after protecting gaps
PrintAddressSpaceLayout can accidentally mmap into the gap.
-rw-r--r--compiler-rt/lib/hwasan/hwasan_linux.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler-rt/lib/hwasan/hwasan_linux.cpp b/compiler-rt/lib/hwasan/hwasan_linux.cpp
index ae14906..0a23ffc 100644
--- a/compiler-rt/lib/hwasan/hwasan_linux.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_linux.cpp
@@ -251,9 +251,6 @@ bool InitShadow() {
CHECK_GT(kLowShadowEnd, kLowShadowStart);
CHECK_GT(kLowShadowStart, kLowMemEnd);
- if (Verbosity())
- PrintAddressSpaceLayout();
-
// Reserve shadow memory.
ReserveShadowMemoryRange(kLowShadowStart, kLowShadowEnd, "low shadow");
ReserveShadowMemoryRange(kHighShadowStart, kHighShadowEnd, "high shadow");
@@ -267,6 +264,9 @@ bool InitShadow() {
if (kHighShadowEnd + 1 < kHighMemStart)
ProtectGap(kHighShadowEnd + 1, kHighMemStart - kHighShadowEnd - 1);
+ if (Verbosity())
+ PrintAddressSpaceLayout();
+
return true;
}