[PATCH] D103564: [NFC][compiler-rt][hwasan] Wrap vfork interceptor with HWASAN_WITH_INTERCEPTORS

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 2 15:33:15 PDT 2021


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__


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103564.349401.patch
Type: text/x-patch
Size: 740 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210602/6d189d26/attachment-0001.bin>


More information about the cfe-commits mailing list