[PATCH] D18413: [asan] Intercept all Heap* related imports from ucrtbase.dll
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 23 13:53:31 PDT 2016
rnk created this revision.
rnk added a reviewer: samsonov.
rnk added a subscriber: llvm-commits.
ucrtbase.dll appears to be built with some kind of cross-module
inlining, because there are calls to imported Heap* routines sprinkled
throughout the code. This inlining defeats our attempts to hotpatch
malloc, _malloc_base, and related functions. Failing to intercept an
allocation or deallocation results in a crash when the program attempts
to deallocate or reallocate memory with the wrong allocator.
This change patches the IAT of ucrtbase.dll to replace the addresses of
the imported Heap* functions with implementations provided by ASan. We
don't globally intercept the win32 Heap* functions because they are
typically used by system DLLs that run before ASan initializes.
Eventually, we may want to intercept them, but for now I think this is
the minimal change that will keep ASan stable.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 10256 bytes
Desc: not available
More information about the llvm-commits