1 1.4 mrg //===-- asan_win.cpp 2 1.4 mrg //------------------------------------------------------===//> 3 1.1 mrg // 4 1.1 mrg // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 1.1 mrg // See https://llvm.org/LICENSE.txt for license information. 6 1.1 mrg // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 1.1 mrg // 8 1.1 mrg //===----------------------------------------------------------------------===// 9 1.1 mrg // 10 1.1 mrg // This file is a part of AddressSanitizer, an address sanity checker. 11 1.1 mrg // 12 1.1 mrg // Windows-specific details. 13 1.1 mrg //===----------------------------------------------------------------------===// 14 1.1 mrg 15 1.1 mrg #include "sanitizer_common/sanitizer_platform.h" 16 1.1 mrg #if SANITIZER_WINDOWS 17 1.4 mrg # define WIN32_LEAN_AND_MEAN 18 1.4 mrg # include <stdlib.h> 19 1.4 mrg # include <windows.h> 20 1.4 mrg 21 1.4 mrg # include "asan_interceptors.h" 22 1.4 mrg # include "asan_internal.h" 23 1.4 mrg # include "asan_mapping.h" 24 1.4 mrg # include "asan_report.h" 25 1.4 mrg # include "asan_stack.h" 26 1.4 mrg # include "asan_thread.h" 27 1.4 mrg # include "sanitizer_common/sanitizer_libc.h" 28 1.4 mrg # include "sanitizer_common/sanitizer_mutex.h" 29 1.4 mrg # include "sanitizer_common/sanitizer_win.h" 30 1.4 mrg # include "sanitizer_common/sanitizer_win_defs.h" 31 1.1 mrg 32 1.1 mrg using namespace __asan; 33 1.1 mrg 34 1.1 mrg extern "C" { 35 1.1 mrg SANITIZER_INTERFACE_ATTRIBUTE 36 1.1 mrg int __asan_should_detect_stack_use_after_return() { 37 1.1 mrg __asan_init(); 38 1.1 mrg return __asan_option_detect_stack_use_after_return; 39 1.1 mrg } 40 1.1 mrg 41 1.1 mrg SANITIZER_INTERFACE_ATTRIBUTE 42 1.1 mrg uptr __asan_get_shadow_memory_dynamic_address() { 43 1.1 mrg __asan_init(); 44 1.1 mrg return __asan_shadow_memory_dynamic_address; 45 1.1 mrg } 46 1.1 mrg } // extern "C" 47 1.1 mrg 48 1.1 mrg // ---------------------- Windows-specific interceptors ---------------- {{{ 49 1.1 mrg static LPTOP_LEVEL_EXCEPTION_FILTER default_seh_handler; 50 1.1 mrg static LPTOP_LEVEL_EXCEPTION_FILTER user_seh_handler; 51 1.1 mrg 52 1.4 mrg extern "C" SANITIZER_INTERFACE_ATTRIBUTE long __asan_unhandled_exception_filter( 53 1.4 mrg EXCEPTION_POINTERS *info) { 54 1.1 mrg EXCEPTION_RECORD *exception_record = info->ExceptionRecord; 55 1.1 mrg CONTEXT *context = info->ContextRecord; 56 1.1 mrg 57 1.1 mrg // FIXME: Handle EXCEPTION_STACK_OVERFLOW here. 58 1.1 mrg 59 1.1 mrg SignalContext sig(exception_record, context); 60 1.1 mrg ReportDeadlySignal(sig); 61 1.1 mrg UNREACHABLE("returned from reporting deadly signal"); 62 1.1 mrg } 63 1.1 mrg 64 1.1 mrg // Wrapper SEH Handler. If the exception should be handled by asan, we call 65 1.1 mrg // __asan_unhandled_exception_filter, otherwise, we execute the user provided 66 1.1 mrg // exception handler or the default. 67 1.1 mrg static long WINAPI SEHHandler(EXCEPTION_POINTERS *info) { 68 1.1 mrg DWORD exception_code = info->ExceptionRecord->ExceptionCode; 69 1.1 mrg if (__sanitizer::IsHandledDeadlyException(exception_code)) 70 1.1 mrg return __asan_unhandled_exception_filter(info); 71 1.1 mrg if (user_seh_handler) 72 1.1 mrg return user_seh_handler(info); 73 1.1 mrg // Bubble out to the default exception filter. 74 1.1 mrg if (default_seh_handler) 75 1.1 mrg return default_seh_handler(info); 76 1.1 mrg return EXCEPTION_CONTINUE_SEARCH; 77 1.1 mrg } 78 1.1 mrg 79 1.1 mrg INTERCEPTOR_WINAPI(LPTOP_LEVEL_EXCEPTION_FILTER, SetUnhandledExceptionFilter, 80 1.1 mrg LPTOP_LEVEL_EXCEPTION_FILTER ExceptionFilter) { 81 1.1 mrg CHECK(REAL(SetUnhandledExceptionFilter)); 82 1.1 mrg if (ExceptionFilter == &SEHHandler) 83 1.1 mrg return REAL(SetUnhandledExceptionFilter)(ExceptionFilter); 84 1.1 mrg // We record the user provided exception handler to be called for all the 85 1.1 mrg // exceptions unhandled by asan. 86 1.1 mrg Swap(ExceptionFilter, user_seh_handler); 87 1.1 mrg return ExceptionFilter; 88 1.1 mrg } 89 1.1 mrg 90 1.1 mrg INTERCEPTOR_WINAPI(void, RtlRaiseException, EXCEPTION_RECORD *ExceptionRecord) { 91 1.1 mrg CHECK(REAL(RtlRaiseException)); 92 1.1 mrg // This is a noreturn function, unless it's one of the exceptions raised to 93 1.1 mrg // communicate with the debugger, such as the one from OutputDebugString. 94 1.1 mrg if (ExceptionRecord->ExceptionCode != DBG_PRINTEXCEPTION_C) 95 1.1 mrg __asan_handle_no_return(); 96 1.1 mrg REAL(RtlRaiseException)(ExceptionRecord); 97 1.1 mrg } 98 1.1 mrg 99 1.1 mrg INTERCEPTOR_WINAPI(void, RaiseException, void *a, void *b, void *c, void *d) { 100 1.1 mrg CHECK(REAL(RaiseException)); 101 1.1 mrg __asan_handle_no_return(); 102 1.1 mrg REAL(RaiseException)(a, b, c, d); 103 1.1 mrg } 104 1.1 mrg 105 1.1 mrg #ifdef _WIN64 106 1.1 mrg 107 1.1 mrg INTERCEPTOR_WINAPI(EXCEPTION_DISPOSITION, __C_specific_handler, 108 1.1 mrg _EXCEPTION_RECORD *a, void *b, _CONTEXT *c, 109 1.1 mrg _DISPATCHER_CONTEXT *d) { 110 1.1 mrg CHECK(REAL(__C_specific_handler)); 111 1.1 mrg __asan_handle_no_return(); 112 1.1 mrg return REAL(__C_specific_handler)(a, b, c, d); 113 1.1 mrg } 114 1.1 mrg 115 1.1 mrg #else 116 1.1 mrg 117 1.1 mrg INTERCEPTOR(int, _except_handler3, void *a, void *b, void *c, void *d) { 118 1.1 mrg CHECK(REAL(_except_handler3)); 119 1.1 mrg __asan_handle_no_return(); 120 1.1 mrg return REAL(_except_handler3)(a, b, c, d); 121 1.1 mrg } 122 1.1 mrg 123 1.1 mrg #if ASAN_DYNAMIC 124 1.1 mrg // This handler is named differently in -MT and -MD CRTs. 125 1.1 mrg #define _except_handler4 _except_handler4_common 126 1.1 mrg #endif 127 1.1 mrg INTERCEPTOR(int, _except_handler4, void *a, void *b, void *c, void *d) { 128 1.1 mrg CHECK(REAL(_except_handler4)); 129 1.1 mrg __asan_handle_no_return(); 130 1.1 mrg return REAL(_except_handler4)(a, b, c, d); 131 1.1 mrg } 132 1.1 mrg #endif 133 1.1 mrg 134 1.4 mrg struct ThreadStartParams { 135 1.4 mrg thread_callback_t start_routine; 136 1.4 mrg void *arg; 137 1.4 mrg }; 138 1.4 mrg 139 1.1 mrg static thread_return_t THREAD_CALLING_CONV asan_thread_start(void *arg) { 140 1.1 mrg AsanThread *t = (AsanThread *)arg; 141 1.1 mrg SetCurrentThread(t); 142 1.4 mrg t->ThreadStart(GetTid()); 143 1.4 mrg 144 1.4 mrg ThreadStartParams params; 145 1.4 mrg t->GetStartData(params); 146 1.4 mrg 147 1.4 mrg auto res = (*params.start_routine)(params.arg); 148 1.4 mrg t->Destroy(); // POSIX calls this from TSD destructor. 149 1.4 mrg return res; 150 1.1 mrg } 151 1.1 mrg 152 1.1 mrg INTERCEPTOR_WINAPI(HANDLE, CreateThread, LPSECURITY_ATTRIBUTES security, 153 1.1 mrg SIZE_T stack_size, LPTHREAD_START_ROUTINE start_routine, 154 1.1 mrg void *arg, DWORD thr_flags, DWORD *tid) { 155 1.1 mrg // Strict init-order checking is thread-hostile. 156 1.1 mrg if (flags()->strict_init_order) 157 1.1 mrg StopInitOrderChecking(); 158 1.1 mrg GET_STACK_TRACE_THREAD; 159 1.1 mrg // FIXME: The CreateThread interceptor is not the same as a pthread_create 160 1.1 mrg // one. This is a bandaid fix for PR22025. 161 1.1 mrg bool detached = false; // FIXME: how can we determine it on Windows? 162 1.1 mrg u32 current_tid = GetCurrentTidOrInvalid(); 163 1.4 mrg ThreadStartParams params = {start_routine, arg}; 164 1.4 mrg AsanThread *t = AsanThread::Create(params, current_tid, &stack, detached); 165 1.1 mrg return REAL(CreateThread)(security, stack_size, asan_thread_start, t, 166 1.1 mrg thr_flags, tid); 167 1.1 mrg } 168 1.1 mrg 169 1.1 mrg // }}} 170 1.1 mrg 171 1.1 mrg namespace __asan { 172 1.1 mrg 173 1.1 mrg void InitializePlatformInterceptors() { 174 1.4 mrg __interception::SetErrorReportCallback(Report); 175 1.4 mrg 176 1.1 mrg // The interceptors were not designed to be removable, so we have to keep this 177 1.1 mrg // module alive for the life of the process. 178 1.1 mrg HMODULE pinned; 179 1.1 mrg CHECK(GetModuleHandleExW( 180 1.1 mrg GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_PIN, 181 1.1 mrg (LPCWSTR)&InitializePlatformInterceptors, &pinned)); 182 1.1 mrg 183 1.1 mrg ASAN_INTERCEPT_FUNC(CreateThread); 184 1.1 mrg ASAN_INTERCEPT_FUNC(SetUnhandledExceptionFilter); 185 1.1 mrg 186 1.1 mrg #ifdef _WIN64 187 1.1 mrg ASAN_INTERCEPT_FUNC(__C_specific_handler); 188 1.1 mrg #else 189 1.1 mrg ASAN_INTERCEPT_FUNC(_except_handler3); 190 1.1 mrg ASAN_INTERCEPT_FUNC(_except_handler4); 191 1.1 mrg #endif 192 1.1 mrg 193 1.1 mrg // Try to intercept kernel32!RaiseException, and if that fails, intercept 194 1.1 mrg // ntdll!RtlRaiseException instead. 195 1.1 mrg if (!::__interception::OverrideFunction("RaiseException", 196 1.1 mrg (uptr)WRAP(RaiseException), 197 1.1 mrg (uptr *)&REAL(RaiseException))) { 198 1.1 mrg CHECK(::__interception::OverrideFunction("RtlRaiseException", 199 1.1 mrg (uptr)WRAP(RtlRaiseException), 200 1.1 mrg (uptr *)&REAL(RtlRaiseException))); 201 1.1 mrg } 202 1.1 mrg } 203 1.1 mrg 204 1.4 mrg void InstallAtExitCheckLeaks() {} 205 1.4 mrg 206 1.1 mrg void AsanApplyToGlobals(globals_op_fptr op, const void *needle) { 207 1.1 mrg UNIMPLEMENTED(); 208 1.1 mrg } 209 1.1 mrg 210 1.3 mrg void FlushUnneededASanShadowMemory(uptr p, uptr size) { 211 1.4 mrg // Only asan on 64-bit Windows supports committing shadow memory on demand. 212 1.4 mrg #if SANITIZER_WINDOWS64 213 1.3 mrg // Since asan's mapping is compacting, the shadow chunk may be 214 1.3 mrg // not page-aligned, so we only flush the page-aligned portion. 215 1.3 mrg ReleaseMemoryPagesToOS(MemToShadow(p), MemToShadow(p + size)); 216 1.4 mrg #endif 217 1.3 mrg } 218 1.3 mrg 219 1.1 mrg // ---------------------- TSD ---------------- {{{ 220 1.1 mrg static bool tsd_key_inited = false; 221 1.1 mrg 222 1.1 mrg static __declspec(thread) void *fake_tsd = 0; 223 1.1 mrg 224 1.1 mrg // https://docs.microsoft.com/en-us/windows/desktop/api/winternl/ns-winternl-_teb 225 1.1 mrg // "[This structure may be altered in future versions of Windows. Applications 226 1.1 mrg // should use the alternate functions listed in this topic.]" 227 1.1 mrg typedef struct _TEB { 228 1.1 mrg PVOID Reserved1[12]; 229 1.1 mrg // PVOID ThreadLocalStoragePointer; is here, at the last field in Reserved1. 230 1.1 mrg PVOID ProcessEnvironmentBlock; 231 1.1 mrg PVOID Reserved2[399]; 232 1.1 mrg BYTE Reserved3[1952]; 233 1.1 mrg PVOID TlsSlots[64]; 234 1.1 mrg BYTE Reserved4[8]; 235 1.1 mrg PVOID Reserved5[26]; 236 1.1 mrg PVOID ReservedForOle; 237 1.1 mrg PVOID Reserved6[4]; 238 1.1 mrg PVOID TlsExpansionSlots; 239 1.1 mrg } TEB, *PTEB; 240 1.1 mrg 241 1.1 mrg constexpr size_t TEB_RESERVED_FIELDS_THREAD_LOCAL_STORAGE_OFFSET = 11; 242 1.1 mrg BOOL IsTlsInitialized() { 243 1.1 mrg PTEB teb = (PTEB)NtCurrentTeb(); 244 1.1 mrg return teb->Reserved1[TEB_RESERVED_FIELDS_THREAD_LOCAL_STORAGE_OFFSET] != 245 1.1 mrg nullptr; 246 1.1 mrg } 247 1.1 mrg 248 1.1 mrg void AsanTSDInit(void (*destructor)(void *tsd)) { 249 1.1 mrg // FIXME: we're ignoring the destructor for now. 250 1.1 mrg tsd_key_inited = true; 251 1.1 mrg } 252 1.1 mrg 253 1.1 mrg void *AsanTSDGet() { 254 1.1 mrg CHECK(tsd_key_inited); 255 1.1 mrg return IsTlsInitialized() ? fake_tsd : nullptr; 256 1.1 mrg } 257 1.1 mrg 258 1.1 mrg void AsanTSDSet(void *tsd) { 259 1.1 mrg CHECK(tsd_key_inited); 260 1.1 mrg fake_tsd = tsd; 261 1.1 mrg } 262 1.1 mrg 263 1.1 mrg void PlatformTSDDtor(void *tsd) { AsanThread::TSDDtor(tsd); } 264 1.1 mrg // }}} 265 1.1 mrg 266 1.1 mrg // ---------------------- Various stuff ---------------- {{{ 267 1.1 mrg void *AsanDoesNotSupportStaticLinkage() { 268 1.1 mrg #if defined(_DEBUG) 269 1.1 mrg #error Please build the runtime with a non-debug CRT: /MD or /MT 270 1.1 mrg #endif 271 1.1 mrg return 0; 272 1.1 mrg } 273 1.1 mrg 274 1.1 mrg uptr FindDynamicShadowStart() { 275 1.4 mrg return MapDynamicShadow(MemToShadowSize(kHighMemEnd), ASAN_SHADOW_SCALE, 276 1.3 mrg /*min_shadow_base_alignment*/ 0, kHighMemEnd); 277 1.1 mrg } 278 1.1 mrg 279 1.1 mrg void AsanCheckDynamicRTPrereqs() {} 280 1.1 mrg 281 1.1 mrg void AsanCheckIncompatibleRT() {} 282 1.1 mrg 283 1.1 mrg void AsanOnDeadlySignal(int, void *siginfo, void *context) { UNIMPLEMENTED(); } 284 1.1 mrg 285 1.3 mrg bool PlatformUnpoisonStacks() { return false; } 286 1.3 mrg 287 1.1 mrg #if SANITIZER_WINDOWS64 288 1.1 mrg // Exception handler for dealing with shadow memory. 289 1.1 mrg static LONG CALLBACK 290 1.1 mrg ShadowExceptionHandler(PEXCEPTION_POINTERS exception_pointers) { 291 1.1 mrg uptr page_size = GetPageSizeCached(); 292 1.1 mrg // Only handle access violations. 293 1.1 mrg if (exception_pointers->ExceptionRecord->ExceptionCode != 294 1.1 mrg EXCEPTION_ACCESS_VIOLATION || 295 1.1 mrg exception_pointers->ExceptionRecord->NumberParameters < 2) { 296 1.1 mrg __asan_handle_no_return(); 297 1.1 mrg return EXCEPTION_CONTINUE_SEARCH; 298 1.1 mrg } 299 1.1 mrg 300 1.1 mrg // Only handle access violations that land within the shadow memory. 301 1.1 mrg uptr addr = 302 1.1 mrg (uptr)(exception_pointers->ExceptionRecord->ExceptionInformation[1]); 303 1.1 mrg 304 1.1 mrg // Check valid shadow range. 305 1.1 mrg if (!AddrIsInShadow(addr)) { 306 1.1 mrg __asan_handle_no_return(); 307 1.1 mrg return EXCEPTION_CONTINUE_SEARCH; 308 1.1 mrg } 309 1.1 mrg 310 1.1 mrg // This is an access violation while trying to read from the shadow. Commit 311 1.1 mrg // the relevant page and let execution continue. 312 1.1 mrg 313 1.1 mrg // Determine the address of the page that is being accessed. 314 1.1 mrg uptr page = RoundDownTo(addr, page_size); 315 1.1 mrg 316 1.1 mrg // Commit the page. 317 1.1 mrg uptr result = 318 1.1 mrg (uptr)::VirtualAlloc((LPVOID)page, page_size, MEM_COMMIT, PAGE_READWRITE); 319 1.1 mrg if (result != page) 320 1.1 mrg return EXCEPTION_CONTINUE_SEARCH; 321 1.1 mrg 322 1.1 mrg // The page mapping succeeded, so continue execution as usual. 323 1.1 mrg return EXCEPTION_CONTINUE_EXECUTION; 324 1.1 mrg } 325 1.1 mrg 326 1.1 mrg #endif 327 1.1 mrg 328 1.1 mrg void InitializePlatformExceptionHandlers() { 329 1.1 mrg #if SANITIZER_WINDOWS64 330 1.1 mrg // On Win64, we map memory on demand with access violation handler. 331 1.1 mrg // Install our exception handler. 332 1.1 mrg CHECK(AddVectoredExceptionHandler(TRUE, &ShadowExceptionHandler)); 333 1.1 mrg #endif 334 1.1 mrg } 335 1.1 mrg 336 1.1 mrg bool IsSystemHeapAddress(uptr addr) { 337 1.1 mrg return ::HeapValidate(GetProcessHeap(), 0, (void *)addr) != FALSE; 338 1.1 mrg } 339 1.1 mrg 340 1.1 mrg // We want to install our own exception handler (EH) to print helpful reports 341 1.1 mrg // on access violations and whatnot. Unfortunately, the CRT initializers assume 342 1.1 mrg // they are run before any user code and drop any previously-installed EHs on 343 1.1 mrg // the floor, so we can't install our handler inside __asan_init. 344 1.1 mrg // (See crt0dat.c in the CRT sources for the details) 345 1.1 mrg // 346 1.1 mrg // Things get even more complicated with the dynamic runtime, as it finishes its 347 1.1 mrg // initialization before the .exe module CRT begins to initialize. 348 1.1 mrg // 349 1.1 mrg // For the static runtime (-MT), it's enough to put a callback to 350 1.1 mrg // __asan_set_seh_filter in the last section for C initializers. 351 1.1 mrg // 352 1.1 mrg // For the dynamic runtime (-MD), we want link the same 353 1.1 mrg // asan_dynamic_runtime_thunk.lib to all the modules, thus __asan_set_seh_filter 354 1.1 mrg // will be called for each instrumented module. This ensures that at least one 355 1.1 mrg // __asan_set_seh_filter call happens after the .exe module CRT is initialized. 356 1.1 mrg extern "C" SANITIZER_INTERFACE_ATTRIBUTE int __asan_set_seh_filter() { 357 1.1 mrg // We should only store the previous handler if it's not our own handler in 358 1.1 mrg // order to avoid loops in the EH chain. 359 1.1 mrg auto prev_seh_handler = SetUnhandledExceptionFilter(SEHHandler); 360 1.1 mrg if (prev_seh_handler != &SEHHandler) 361 1.1 mrg default_seh_handler = prev_seh_handler; 362 1.1 mrg return 0; 363 1.1 mrg } 364 1.1 mrg 365 1.1 mrg bool HandleDlopenInit() { 366 1.1 mrg // Not supported on this platform. 367 1.1 mrg static_assert(!SANITIZER_SUPPORTS_INIT_FOR_DLOPEN, 368 1.1 mrg "Expected SANITIZER_SUPPORTS_INIT_FOR_DLOPEN to be false"); 369 1.1 mrg return false; 370 1.1 mrg } 371 1.1 mrg 372 1.1 mrg #if !ASAN_DYNAMIC 373 1.1 mrg // The CRT runs initializers in this order: 374 1.1 mrg // - C initializers, from XIA to XIZ 375 1.1 mrg // - C++ initializers, from XCA to XCZ 376 1.1 mrg // Prior to 2015, the CRT set the unhandled exception filter at priority XIY, 377 1.1 mrg // near the end of C initialization. Starting in 2015, it was moved to the 378 1.1 mrg // beginning of C++ initialization. We set our priority to XCAB to run 379 1.1 mrg // immediately after the CRT runs. This way, our exception filter is called 380 1.1 mrg // first and we can delegate to their filter if appropriate. 381 1.1 mrg #pragma section(".CRT$XCAB", long, read) 382 1.1 mrg __declspec(allocate(".CRT$XCAB")) int (*__intercept_seh)() = 383 1.1 mrg __asan_set_seh_filter; 384 1.1 mrg 385 1.1 mrg // Piggyback on the TLS initialization callback directory to initialize asan as 386 1.1 mrg // early as possible. Initializers in .CRT$XL* are called directly by ntdll, 387 1.1 mrg // which run before the CRT. Users also add code to .CRT$XLC, so it's important 388 1.1 mrg // to run our initializers first. 389 1.1 mrg static void NTAPI asan_thread_init(void *module, DWORD reason, void *reserved) { 390 1.1 mrg if (reason == DLL_PROCESS_ATTACH) 391 1.1 mrg __asan_init(); 392 1.1 mrg } 393 1.1 mrg 394 1.1 mrg #pragma section(".CRT$XLAB", long, read) 395 1.1 mrg __declspec(allocate(".CRT$XLAB")) void(NTAPI *__asan_tls_init)( 396 1.1 mrg void *, unsigned long, void *) = asan_thread_init; 397 1.1 mrg #endif 398 1.1 mrg 399 1.1 mrg static void NTAPI asan_thread_exit(void *module, DWORD reason, void *reserved) { 400 1.1 mrg if (reason == DLL_THREAD_DETACH) { 401 1.1 mrg // Unpoison the thread's stack because the memory may be re-used. 402 1.1 mrg NT_TIB *tib = (NT_TIB *)NtCurrentTeb(); 403 1.1 mrg uptr stackSize = (uptr)tib->StackBase - (uptr)tib->StackLimit; 404 1.1 mrg __asan_unpoison_memory_region(tib->StackLimit, stackSize); 405 1.1 mrg } 406 1.1 mrg } 407 1.1 mrg 408 1.1 mrg #pragma section(".CRT$XLY", long, read) 409 1.1 mrg __declspec(allocate(".CRT$XLY")) void(NTAPI *__asan_tls_exit)( 410 1.1 mrg void *, unsigned long, void *) = asan_thread_exit; 411 1.1 mrg 412 1.1 mrg WIN_FORCE_LINK(__asan_dso_reg_hook) 413 1.1 mrg 414 1.1 mrg // }}} 415 1.1 mrg } // namespace __asan 416 1.1 mrg 417 1.1 mrg #endif // SANITIZER_WINDOWS 418