From: Dmitry Vyukov Date: Fri, 5 Dec 2014 10:06:06 +0000 (+0000) Subject: tsan: protect trace memory range on startup X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf253a3d3fa11b1a2b11c310bebc7bfa918ec64f;p=platform%2Fupstream%2Fllvm.git tsan: protect trace memory range on startup so that user does not map something there ahead of us llvm-svn: 223456 --- diff --git a/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc b/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc index 46b648c..4612741 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc @@ -324,6 +324,9 @@ static void CheckAndProtect() { ProtectRange(kLoAppMemEnd, kShadowBeg); ProtectRange(kShadowEnd, kMetaShadowBeg); ProtectRange(kMetaShadowEnd, kTraceMemBeg); + // Memory for traces is mapped lazily in MapThreadTrace. + // Protect the whole range for now, so that user does not map something here. + ProtectRange(kTraceMemBeg, kTraceMemEnd); ProtectRange(kTraceMemEnd, kHeapMemBeg); ProtectRange(kHeapMemEnd + PrimaryAllocator::AdditionalSize(), kHiAppMemBeg); }