Skip to content

Commit db3d337

Browse files
committed
[NFC][hwasan] Print after protecting gaps
PrintAddressSpaceLayout can accidentally mmap into the gap.
1 parent ce2b280 commit db3d337

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler-rt/lib/hwasan/hwasan_linux.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,6 @@ bool InitShadow() {
251251
CHECK_GT(kLowShadowEnd, kLowShadowStart);
252252
CHECK_GT(kLowShadowStart, kLowMemEnd);
253253

254-
if (Verbosity())
255-
PrintAddressSpaceLayout();
256-
257254
// Reserve shadow memory.
258255
ReserveShadowMemoryRange(kLowShadowStart, kLowShadowEnd, "low shadow");
259256
ReserveShadowMemoryRange(kHighShadowStart, kHighShadowEnd, "high shadow");
@@ -267,6 +264,9 @@ bool InitShadow() {
267264
if (kHighShadowEnd + 1 < kHighMemStart)
268265
ProtectGap(kHighShadowEnd + 1, kHighMemStart - kHighShadowEnd - 1);
269266

267+
if (Verbosity())
268+
PrintAddressSpaceLayout();
269+
270270
return true;
271271
}
272272

0 commit comments

Comments
 (0)