summaryrefslogtreecommitdiff
path: root/lib/hwasan/hwasan_interceptors.cpp
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2019-02-27 21:11:50 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2019-02-27 21:11:50 +0000
commit9cde2249660f19f4ffa6d7703cecfdced27f9917 (patch)
tree3a43912617386db72ff90fe311d8119bb793aa11 /lib/hwasan/hwasan_interceptors.cpp
parent8015adf96f55714e240cec187adfdcffbddbe2b6 (diff)
downloadcompiler-rt-9cde2249660f19f4ffa6d7703cecfdced27f9917.tar.gz
[hwasan, asan] Intercept vfork.
Summary: Intercept vfork on arm, aarch64, i386 and x86_64. Reviewers: pcc, vitalybuka Subscribers: kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58533 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@355030 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/hwasan/hwasan_interceptors.cpp')
-rw-r--r--lib/hwasan/hwasan_interceptors.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/hwasan/hwasan_interceptors.cpp b/lib/hwasan/hwasan_interceptors.cpp
index 3b087e157..326309751 100644
--- a/lib/hwasan/hwasan_interceptors.cpp
+++ b/lib/hwasan/hwasan_interceptors.cpp
@@ -227,6 +227,11 @@ INTERCEPTOR(int, pthread_create, void *th, void *attr,
}
#endif
+#if HWASAN_WITH_INTERCEPTORS
+DEFINE_REAL(int, vfork);
+DECLARE_EXTERN_INTERCEPTOR_AND_WRAPPER(int, vfork);
+#endif
+
static void BeforeFork() {
StackDepotLockAll();
}
@@ -266,9 +271,12 @@ void InitializeInterceptors() {
INTERCEPT_FUNCTION(fork);
#if HWASAN_WITH_INTERCEPTORS
+#if defined(__linux__)
+ INTERCEPT_FUNCTION(vfork);
+#endif // __linux__
#if !defined(__aarch64__)
INTERCEPT_FUNCTION(pthread_create);
-#endif
+#endif // __aarch64__
INTERCEPT_FUNCTION(realloc);
INTERCEPT_FUNCTION(free);
#endif