diff options
author | Reid Kleckner <reid@kleckner.net> | 2013-03-11 18:07:42 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2013-03-11 18:07:42 +0000 |
commit | 0f92deb81207c80481ff0257fbaba640fe669633 (patch) | |
tree | d607657bc3c761a28ef7798195339f04fc8d837b /lib/msan/msan_interface_internal.h | |
parent | ce700979f644c790c2d9d80f5cc2a1ada0380284 (diff) |
[msan] intercept dlopen and clear shadow for it
Summary:
The loader does not call mmap() through the PLT because it has to
bootstrap the process before libc is present. Hooking dlopen() isn't
enough either because the loader runs module initializers before
returning, and they could run arbitrary msan instrumented code.
If msandr is present, then we can intercept the mmaps from dlopen at the
syscall layer and clear the shadow there. If msandr is missing, we
clear the shadow after dlopen() and hope any initializers are trivial.
Reviewers: eugenis
CC: kcc, llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D509
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@176818 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan/msan_interface_internal.h')
-rw-r--r-- | lib/msan/msan_interface_internal.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/msan/msan_interface_internal.h b/lib/msan/msan_interface_internal.h index 905c5b793..e1cd13c3f 100644 --- a/lib/msan/msan_interface_internal.h +++ b/lib/msan/msan_interface_internal.h @@ -104,6 +104,10 @@ int __msan_get_retval_tls_offset(); SANITIZER_INTERFACE_ATTRIBUTE int __msan_get_param_tls_offset(); +// For intercepting mmap from ld.so in msandr. +SANITIZER_INTERFACE_ATTRIBUTE +bool __msan_is_in_loader(); + // For testing. SANITIZER_INTERFACE_ATTRIBUTE u32 __msan_get_umr_origin(); |