Skip to content

Commit 02a029f

Browse files
committed
hwasan: lay groundwork for importing subset of sanitizer_common interceptors [NFC]
This patch does the bare minimum to import sanitizer_common_interceptors, but without actually enabling any interceptors or meaningfully defining the COMMON_INTERCEPT macros. This will allow selectively enabling sanitizer_common interceptors (if the appropriate macros are defined), as suggested by Vitaly in D149701. Differential Revision: https://reviews.llvm.org/D150708
1 parent a5d98be commit 02a029f

File tree

2 files changed

+725
-0
lines changed

2 files changed

+725
-0
lines changed

compiler-rt/lib/hwasan/hwasan_interceptors.cpp

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "hwasan.h"
1818
#include "hwasan_checks.h"
19+
#include "hwasan_platform_interceptors.h"
1920
#include "hwasan_thread.h"
2021
#include "hwasan_thread_list.h"
2122
#include "interception/interception.h"
@@ -44,6 +45,68 @@ using namespace __hwasan;
4445
# include "sanitizer_common/sanitizer_common_syscalls.inc"
4546
# include "sanitizer_common/sanitizer_syscalls_netbsd.inc"
4647

48+
#define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size) \
49+
do { \
50+
} while (false)
51+
52+
#define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size) \
53+
do { \
54+
} while (false)
55+
56+
#define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \
57+
do { \
58+
} while (false)
59+
60+
#define COMMON_INTERCEPTOR_DIR_ACQUIRE(ctx, path) \
61+
do { \
62+
} while (false)
63+
64+
#define COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd) \
65+
do { \
66+
} while (false)
67+
68+
#define COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd) \
69+
do { \
70+
} while (false)
71+
72+
#define COMMON_INTERCEPTOR_FD_SOCKET_ACCEPT(ctx, fd, newfd) \
73+
do { \
74+
} while (false)
75+
76+
#define COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, name) \
77+
do { \
78+
} while (false)
79+
80+
#define COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, name) \
81+
do { \
82+
} while (false)
83+
84+
#define COMMON_INTERCEPTOR_BLOCK_REAL(name) \
85+
do { \
86+
} while (false)
87+
88+
#define COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, to, from, size) \
89+
do { \
90+
} while (false)
91+
92+
#define COMMON_INTERCEPTOR_MEMCPY_IMPL(ctx, to, from, size) \
93+
do { \
94+
} while (false)
95+
96+
#define COMMON_INTERCEPTOR_MEMSET_IMPL(ctx, block, c, size) \
97+
do { \
98+
} while (false)
99+
100+
#define COMMON_INTERCEPTOR_STRERROR() \
101+
do { \
102+
} while (false)
103+
104+
#define COMMON_INTERCEPT_FUNCTION(name) \
105+
do { \
106+
} while (false)
107+
108+
#include "sanitizer_common/sanitizer_common_interceptors.inc"
109+
47110
struct ThreadStartArg {
48111
__sanitizer_sigset_t starting_sigset_;
49112
};

0 commit comments

Comments
 (0)