[compiler-rt] r355137 - [hwasan] Fix vfork handling with large stack limit.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 28 12:43:24 PST 2019


Author: eugenis
Date: Thu Feb 28 12:43:24 2019
New Revision: 355137

URL: http://llvm.org/viewvc/llvm-project?rev=355137&view=rev
Log:
[hwasan] Fix vfork handling with large stack limit.

Remove the maximum stack cleanup size check. With ulimit -s unlimited
main thread stack can be very large, but we don't really have a choice
other than cleaning all of it. It should be reasonably fast - hwasan
cleans large shadow ranges with a single madvise call.

This change fixes check-hwasan after ulimit -s unlimited.

Modified:
    compiler-rt/trunk/lib/hwasan/hwasan.cpp

Modified: compiler-rt/trunk/lib/hwasan/hwasan.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/hwasan/hwasan.cpp?rev=355137&r1=355136&r2=355137&view=diff
==============================================================================
--- compiler-rt/trunk/lib/hwasan/hwasan.cpp (original)
+++ compiler-rt/trunk/lib/hwasan/hwasan.cpp Thu Feb 28 12:43:24 2019
@@ -488,9 +488,7 @@ void __hwasan_handle_vfork(const void *s
   CHECK(t);
   uptr top = t->stack_top();
   uptr bottom = t->stack_bottom();
-  static const uptr kMaxExpectedCleanupSize = 64 << 20;  // 64M
-  if (top == 0 || bottom == 0 || sp < bottom || sp >= top ||
-      sp - bottom > kMaxExpectedCleanupSize) {
+  if (top == 0 || bottom == 0 || sp < bottom || sp >= top) {
     Report(
         "WARNING: HWASan is ignoring requested __hwasan_handle_vfork: "
         "stack top: %zx; current %zx; bottom: %zx \n"




More information about the llvm-commits mailing list