[PATCH] [msan] intercept dlopen and clear shadow for it

Reid Kleckner rnk at google.com
Fri Mar 8 13:39:12 PST 2013


Hi eugenis,

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.

http://llvm-reviews.chandlerc.com/D509

Files:
  lib/msan/msan.cc
  lib/msan/msan.h
  lib/msan/msan_interceptors.cc
  lib/msan/msan_interface_internal.h
  lib/msan/msan_linux.cc
  lib/msan/tests/CMakeLists.txt
  lib/msan/tests/msan_loadable.cc
  lib/msan/tests/msan_test.cc
  lib/msandr/msandr.cc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D509.1.patch
Type: text/x-patch
Size: 16463 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130308/dcdf1909/attachment.bin>


More information about the llvm-commits mailing list