summaryrefslogtreecommitdiff
path: root/lib/msan
diff options
context:
space:
mode:
authorMatt Morehouse <mascasa@google.com>2018-07-06 17:10:51 +0000
committerMatt Morehouse <mascasa@google.com>2018-07-06 17:10:51 +0000
commit711b418e467ddd86fed8cc22ae5ec7e311281376 (patch)
treebebebbb771d0e4574555a25deefb9c7324757842 /lib/msan
parentb89b5a6ea136eec77af5da51ce4f2f9b7e933ec6 (diff)
[MSan] Add functions to enable/disable interceptor checks.
Summary: The motivation for this change is to make libFuzzer+MSan possible without instrumenting libFuzzer. See https://github.com/google/sanitizers/issues/958. Reviewers: eugenis Reviewed By: eugenis Subscribers: llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D48890 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336447 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan')
-rw-r--r--lib/msan/msan_interceptors.cc3
-rw-r--r--lib/msan/msan_interface_internal.h6
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/msan/msan_interceptors.cc b/lib/msan/msan_interceptors.cc
index 48d038131..b3429bcf0 100644
--- a/lib/msan/msan_interceptors.cc
+++ b/lib/msan/msan_interceptors.cc
@@ -60,6 +60,9 @@ DECLARE_REAL(void *, memset, void *dest, int c, uptr n)
// True if this is a nested interceptor.
static THREADLOCAL int in_interceptor_scope;
+void __msan_scoped_disable_interceptor_checks() { ++in_interceptor_scope; }
+void __msan_scoped_enable_interceptor_checks() { --in_interceptor_scope; }
+
struct InterceptorScope {
InterceptorScope() { ++in_interceptor_scope; }
~InterceptorScope() { --in_interceptor_scope; }
diff --git a/lib/msan/msan_interface_internal.h b/lib/msan/msan_interface_internal.h
index c6990db24..9a67cbc9b 100644
--- a/lib/msan/msan_interface_internal.h
+++ b/lib/msan/msan_interface_internal.h
@@ -174,6 +174,12 @@ void __msan_set_death_callback(void (*callback)(void));
SANITIZER_INTERFACE_ATTRIBUTE
void __msan_copy_shadow(void *dst, const void *src, uptr size);
+
+SANITIZER_INTERFACE_ATTRIBUTE
+void __msan_scoped_disable_interceptor_checks();
+
+SANITIZER_INTERFACE_ATTRIBUTE
+void __msan_scoped_enable_interceptor_checks();
} // extern "C"
#endif // MSAN_INTERFACE_INTERNAL_H