[compiler-rt] 70e0c8f - Revert 'hwasan: lay groundwork for importing subset of sanitizer_common interceptors [NFC]'

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 13:28:55 PDT 2023


Author: Thurston Dang
Date: 2023-05-17T20:28:36Z
New Revision: 70e0c8ffcb71486b17bdee305ba49e80b03d00f5

URL: https://github.com/llvm/llvm-project/commit/70e0c8ffcb71486b17bdee305ba49e80b03d00f5
DIFF: https://github.com/llvm/llvm-project/commit/70e0c8ffcb71486b17bdee305ba49e80b03d00f5.diff

LOG: Revert 'hwasan: lay groundwork for importing subset of sanitizer_common interceptors [NFC]'

It was reported in https://reviews.llvm.org/D150708 that my patch has broken
stage2/hwasan check: https://lab.llvm.org/buildbot/#/builders/236/builds/4069

Reverting that patch (and the followup fixes) until I can investigate this further

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp
index 3c597623333c..f87e6a2ba44c 100644
--- a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp
@@ -16,7 +16,6 @@
 
 #include "hwasan.h"
 #include "hwasan_checks.h"
-#include "hwasan_platform_interceptors.h"
 #include "hwasan_thread.h"
 #include "hwasan_thread_list.h"
 #include "interception/interception.h"
@@ -45,104 +44,6 @@ using namespace __hwasan;
 #    include "sanitizer_common/sanitizer_common_syscalls.inc"
 #    include "sanitizer_common/sanitizer_syscalls_netbsd.inc"
 
-#define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size) \
-  do {                                                \
-  } while (false)
-
-#define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size) \
-  do {                                                \
-    (void)(ctx);                                      \
-    (void)(ptr);                                      \
-    (void)(size);                                     \
-  } while (false)
-
-#define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \
-  do {                                           \
-    (void)(ctx);                                 \
-    (void)(func);                                \
-  } while (false)
-
-#define COMMON_INTERCEPTOR_DIR_ACQUIRE(ctx, path) \
-  do {                                            \
-    (void)(ctx);                                  \
-    (void)(path);                                 \
-  } while (false)
-
-#define COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd) \
-  do {                                         \
-    (void)(ctx);                               \
-    (void)(fd);                                \
-  } while (false)
-
-#define COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd) \
-  do {                                         \
-    (void)(ctx);                               \
-    (void)(fd);                                \
-  } while (false)
-
-#define COMMON_INTERCEPTOR_FD_SOCKET_ACCEPT(ctx, fd, newfd) \
-  do {                                                      \
-    (void)(ctx);                                            \
-    (void)(fd);                                             \
-    (void)(newfd);                                          \
-  } while (false)
-
-#define COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, name) \
-  do {                                                \
-    (void)(ctx);                                      \
-    (void)(name);                                     \
-  } while (false)
-
-#define COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, name) \
-  do {                                                         \
-    (void)(ctx);                                               \
-    (void)(thread);                                            \
-    (void)(name);                                              \
-  } while (false)
-
-#define COMMON_INTERCEPTOR_BLOCK_REAL(name) \
-  do {                                      \
-    (void)(name);                           \
-  } while (false)
-
-#define COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, to, from, size) \
-  do {                                                       \
-    (void)(ctx);                                             \
-    (void)(to);                                              \
-    (void)(from);                                            \
-    (void)(size);                                            \
-  } while (false)
-
-#define COMMON_INTERCEPTOR_MEMCPY_IMPL(ctx, to, from, size) \
-  do {                                                      \
-    (void)(ctx);                                            \
-    (void)(to);                                             \
-    (void)(from);                                           \
-    (void)(size);                                           \
-  } while (false)
-
-#define COMMON_INTERCEPTOR_MEMSET_IMPL(ctx, block, c, size) \
-  do {                                                      \
-    (void)(ctx);                                            \
-    (void)(block);                                          \
-    (void)(c);                                              \
-    (void)(size);                                           \
-  } while (false)
-
-#define COMMON_INTERCEPTOR_STRERROR() \
-  do {                                \
-  } while (false)
-
-#define COMMON_INTERCEPT_FUNCTION(name) \
-  do {                                  \
-    (void)(name);                       \
-  } while (false)
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-function"
-#include "sanitizer_common/sanitizer_common_interceptors.inc"
-#pragma clang diagnostic pop
-
 struct ThreadStartArg {
   __sanitizer_sigset_t starting_sigset_;
 };
@@ -416,10 +317,6 @@ void InitializeInterceptors() {
   static int inited = 0;
   CHECK_EQ(inited, 0);
 
-  (void)(InitializeCommonInterceptors);
-  (void)(read_iovec);
-  (void)(write_iovec);
-
 #  if HWASAN_WITH_INTERCEPTORS
 #    if defined(__linux__)
   INTERCEPT_FUNCTION(__libc_longjmp);


        


More information about the llvm-commits mailing list