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 | c9d382b5a49feff338d730e160c35c2f29f24711 (patch) | |
| tree | 815c535d2ebf8c7e93d759889df7b1fffc87a156 /compiler-rt/lib/msan/msan_interface_internal.h | |
| parent | 06d274fdb7c82bbfdd1ff262054f5286bef930f8 (diff) | |
| download | bcm5719-llvm-c9d382b5a49feff338d730e160c35c2f29f24711.tar.gz bcm5719-llvm-c9d382b5a49feff338d730e160c35c2f29f24711.zip | |
[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
llvm-svn: 176818
Diffstat (limited to 'compiler-rt/lib/msan/msan_interface_internal.h')
| -rw-r--r-- | compiler-rt/lib/msan/msan_interface_internal.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler-rt/lib/msan/msan_interface_internal.h b/compiler-rt/lib/msan/msan_interface_internal.h index 905c5b79398..e1cd13c3f73 100644 --- a/compiler-rt/lib/msan/msan_interface_internal.h +++ b/compiler-rt/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(); |

