[PATCH] D52505: [winasan] Pin the ASan DLL to prevent unloading
David Major via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 26 09:31:27 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL343123: [winasan] Pin the ASan DLL to prevent unloading (authored by dmajor, committed by ).
Herald added subscribers: llvm-commits, delcypher.
Changed prior to commit:
https://reviews.llvm.org/D52505?vs=167022&id=167154#toc
Repository:
rL LLVM
https://reviews.llvm.org/D52505
Files:
compiler-rt/trunk/lib/asan/asan_win.cc
Index: compiler-rt/trunk/lib/asan/asan_win.cc
===================================================================
--- compiler-rt/trunk/lib/asan/asan_win.cc
+++ compiler-rt/trunk/lib/asan/asan_win.cc
@@ -167,6 +167,14 @@
namespace __asan {
void InitializePlatformInterceptors() {
+ // The interceptors were not designed to be removable, so we have to keep this
+ // module alive for the life of the process.
+ HMODULE pinned;
+ CHECK(GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
+ GET_MODULE_HANDLE_EX_FLAG_PIN,
+ (LPCWSTR)&InitializePlatformInterceptors,
+ &pinned));
+
ASAN_INTERCEPT_FUNC(CreateThread);
ASAN_INTERCEPT_FUNC(SetUnhandledExceptionFilter);
CHECK(::__interception::OverrideFunction("NtTerminateThread",
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52505.167154.patch
Type: text/x-patch
Size: 828 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180926/a9655d70/attachment.bin>
More information about the llvm-commits
mailing list