leonardchan created this revision.
leonardchan added reviewers: phosek, mcgrathr, eugenis, vitalybuka.
leonardchan added a project: Sanitizers.
Herald added a subscriber: dberris.
leonardchan requested review of this revision.
Herald added a subscriber: Sanitizers.

This prevents emitting the vfork interceptor when interceptors are disabled in 
a hwasan implementation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103564

Files:
  compiler-rt/lib/hwasan/hwasan_interceptors.cpp


Index: compiler-rt/lib/hwasan/hwasan_interceptors.cpp
===================================================================
--- compiler-rt/lib/hwasan/hwasan_interceptors.cpp
+++ compiler-rt/lib/hwasan/hwasan_interceptors.cpp
@@ -303,6 +303,7 @@
 
 #endif // HWASAN_WITH_INTERCEPTORS && __aarch64__
 
+#if HWASAN_WITH_INTERCEPTORS
 static void BeforeFork() {
   StackDepotLockAll();
 }
@@ -318,6 +319,7 @@
   AfterFork();
   return pid;
 }
+#endif  // HWASAN_WITH_INTERCEPTORS
 
 namespace __hwasan {
 
@@ -334,9 +336,9 @@
   static int inited = 0;
   CHECK_EQ(inited, 0);
 
+#if HWASAN_WITH_INTERCEPTORS
   INTERCEPT_FUNCTION(fork);
 
-#if HWASAN_WITH_INTERCEPTORS
 #if defined(__linux__)
   INTERCEPT_FUNCTION(vfork);
 #endif  // __linux__


Index: compiler-rt/lib/hwasan/hwasan_interceptors.cpp
===================================================================
--- compiler-rt/lib/hwasan/hwasan_interceptors.cpp
+++ compiler-rt/lib/hwasan/hwasan_interceptors.cpp
@@ -303,6 +303,7 @@
 
 #endif // HWASAN_WITH_INTERCEPTORS && __aarch64__
 
+#if HWASAN_WITH_INTERCEPTORS
 static void BeforeFork() {
   StackDepotLockAll();
 }
@@ -318,6 +319,7 @@
   AfterFork();
   return pid;
 }
+#endif  // HWASAN_WITH_INTERCEPTORS
 
 namespace __hwasan {
 
@@ -334,9 +336,9 @@
   static int inited = 0;
   CHECK_EQ(inited, 0);
 
+#if HWASAN_WITH_INTERCEPTORS
   INTERCEPT_FUNCTION(fork);
 
-#if HWASAN_WITH_INTERCEPTORS
 #if defined(__linux__)
   INTERCEPT_FUNCTION(vfork);
 #endif  // __linux__
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to