1 //===-- asan_rtl.cpp ------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file is a part of AddressSanitizer, an address sanity checker.
11 // Main file of the ASan run-time library.
12 //===----------------------------------------------------------------------===//
14 #include "asan_activation.h"
15 #include "asan_allocator.h"
16 #include "asan_fake_stack.h"
17 #include "asan_interceptors.h"
18 #include "asan_interface_internal.h"
19 #include "asan_internal.h"
20 #include "asan_mapping.h"
21 #include "asan_poisoning.h"
22 #include "asan_report.h"
23 #include "asan_stack.h"
24 #include "asan_stats.h"
25 #include "asan_suppressions.h"
26 #include "asan_thread.h"
27 #include "lsan/lsan_common.h"
28 #include "sanitizer_common/sanitizer_atomic.h"
29 #include "sanitizer_common/sanitizer_flags.h"
30 #include "sanitizer_common/sanitizer_libc.h"
31 #include "sanitizer_common/sanitizer_symbolizer.h"
32 #include "ubsan/ubsan_init.h"
33 #include "ubsan/ubsan_platform.h"
35 uptr __asan_shadow_memory_dynamic_address
; // Global interface symbol.
36 int __asan_option_detect_stack_use_after_return
; // Global interface symbol.
37 uptr
*__asan_test_only_reported_buggy_pointer
; // Used only for testing asan.
41 uptr AsanMappingProfile
[kAsanMappingProfileSize
];
43 static void AsanDie() {
44 static atomic_uint32_t num_calls
;
45 if (atomic_fetch_add(&num_calls
, 1, memory_order_relaxed
) != 0) {
46 // Don't die twice - run a busy loop.
49 if (common_flags()->print_module_map
>= 1)
51 if (flags()->sleep_before_dying
) {
52 Report("Sleeping for %d second(s)\n", flags()->sleep_before_dying
);
53 SleepForSeconds(flags()->sleep_before_dying
);
55 if (flags()->unmap_shadow_on_exit
) {
57 UnmapOrDie((void*)kLowShadowBeg
, kMidMemBeg
- kLowShadowBeg
);
58 UnmapOrDie((void*)kMidMemEnd
, kHighShadowEnd
- kMidMemEnd
);
61 UnmapOrDie((void*)kLowShadowBeg
, kHighShadowEnd
- kLowShadowBeg
);
66 static void CheckUnwind() {
67 GET_STACK_TRACE(kStackTraceMax
, common_flags()->fast_unwind_on_check
);
71 // -------------------------- Globals --------------------- {{{1
73 bool asan_init_is_running
;
75 #if !ASAN_FIXED_MAPPING
76 uptr kHighMemEnd
, kMidMemBeg
, kMidMemEnd
;
79 // -------------------------- Misc ---------------- {{{1
80 void ShowStatsAndAbort() {
81 __asan_print_accumulated_stats();
86 static void ReportGenericErrorWrapper(uptr addr
, bool is_write
, int size
,
87 int exp_arg
, bool fatal
) {
88 if (__asan_test_only_reported_buggy_pointer
) {
89 *__asan_test_only_reported_buggy_pointer
= addr
;
92 ReportGenericError(pc
, bp
, sp
, addr
, is_write
, size
, exp_arg
, fatal
);
96 // --------------- LowLevelAllocateCallbac ---------- {{{1
97 static void OnLowLevelAllocate(uptr ptr
, uptr size
) {
98 PoisonShadow(ptr
, size
, kAsanInternalHeapMagic
);
101 // -------------------------- Run-time entry ------------------- {{{1
102 // exported functions
103 #define ASAN_REPORT_ERROR(type, is_write, size) \
104 extern "C" NOINLINE INTERFACE_ATTRIBUTE \
105 void __asan_report_ ## type ## size(uptr addr) { \
106 GET_CALLER_PC_BP_SP; \
107 ReportGenericError(pc, bp, sp, addr, is_write, size, 0, true); \
109 extern "C" NOINLINE INTERFACE_ATTRIBUTE \
110 void __asan_report_exp_ ## type ## size(uptr addr, u32 exp) { \
111 GET_CALLER_PC_BP_SP; \
112 ReportGenericError(pc, bp, sp, addr, is_write, size, exp, true); \
114 extern "C" NOINLINE INTERFACE_ATTRIBUTE \
115 void __asan_report_ ## type ## size ## _noabort(uptr addr) { \
116 GET_CALLER_PC_BP_SP; \
117 ReportGenericError(pc, bp, sp, addr, is_write, size, 0, false); \
120 ASAN_REPORT_ERROR(load, false, 1)
121 ASAN_REPORT_ERROR(load
, false, 2)
122 ASAN_REPORT_ERROR(load
, false, 4)
123 ASAN_REPORT_ERROR(load
, false, 8)
124 ASAN_REPORT_ERROR(load
, false, 16)
125 ASAN_REPORT_ERROR(store
, true, 1)
126 ASAN_REPORT_ERROR(store
, true, 2)
127 ASAN_REPORT_ERROR(store
, true, 4)
128 ASAN_REPORT_ERROR(store
, true, 8)
129 ASAN_REPORT_ERROR(store
, true, 16)
131 #define ASAN_REPORT_ERROR_N(type, is_write) \
132 extern "C" NOINLINE INTERFACE_ATTRIBUTE \
133 void __asan_report_ ## type ## _n(uptr addr, uptr size) { \
134 GET_CALLER_PC_BP_SP; \
135 ReportGenericError(pc, bp, sp, addr, is_write, size, 0, true); \
137 extern "C" NOINLINE INTERFACE_ATTRIBUTE \
138 void __asan_report_exp_ ## type ## _n(uptr addr, uptr size, u32 exp) { \
139 GET_CALLER_PC_BP_SP; \
140 ReportGenericError(pc, bp, sp, addr, is_write, size, exp, true); \
142 extern "C" NOINLINE INTERFACE_ATTRIBUTE \
143 void __asan_report_ ## type ## _n_noabort(uptr addr, uptr size) { \
144 GET_CALLER_PC_BP_SP; \
145 ReportGenericError(pc, bp, sp, addr, is_write, size, 0, false); \
148 ASAN_REPORT_ERROR_N(load, false)
149 ASAN_REPORT_ERROR_N(store
, true)
151 #define ASAN_MEMORY_ACCESS_CALLBACK_BODY(type, is_write, size, exp_arg, fatal) \
152 uptr sp = MEM_TO_SHADOW(addr); \
153 uptr s = size <= SHADOW_GRANULARITY ? *reinterpret_cast<u8 *>(sp) \
154 : *reinterpret_cast<u16 *>(sp); \
156 if (UNLIKELY(size >= SHADOW_GRANULARITY || \
157 ((s8)((addr & (SHADOW_GRANULARITY - 1)) + size - 1)) >= \
159 ReportGenericErrorWrapper(addr, is_write, size, exp_arg, fatal); \
163 #define ASAN_MEMORY_ACCESS_CALLBACK(type, is_write, size) \
164 extern "C" NOINLINE INTERFACE_ATTRIBUTE \
165 void __asan_##type##size(uptr addr) { \
166 ASAN_MEMORY_ACCESS_CALLBACK_BODY(type, is_write, size, 0, true) \
168 extern "C" NOINLINE INTERFACE_ATTRIBUTE \
169 void __asan_exp_##type##size(uptr addr, u32 exp) { \
170 ASAN_MEMORY_ACCESS_CALLBACK_BODY(type, is_write, size, exp, true) \
172 extern "C" NOINLINE INTERFACE_ATTRIBUTE \
173 void __asan_##type##size ## _noabort(uptr addr) { \
174 ASAN_MEMORY_ACCESS_CALLBACK_BODY(type, is_write, size, 0, false) \
177 ASAN_MEMORY_ACCESS_CALLBACK(load, false, 1)
178 ASAN_MEMORY_ACCESS_CALLBACK(load
, false, 2)
179 ASAN_MEMORY_ACCESS_CALLBACK(load
, false, 4)
180 ASAN_MEMORY_ACCESS_CALLBACK(load
, false, 8)
181 ASAN_MEMORY_ACCESS_CALLBACK(load
, false, 16)
182 ASAN_MEMORY_ACCESS_CALLBACK(store
, true, 1)
183 ASAN_MEMORY_ACCESS_CALLBACK(store
, true, 2)
184 ASAN_MEMORY_ACCESS_CALLBACK(store
, true, 4)
185 ASAN_MEMORY_ACCESS_CALLBACK(store
, true, 8)
186 ASAN_MEMORY_ACCESS_CALLBACK(store
, true, 16)
189 NOINLINE INTERFACE_ATTRIBUTE
190 void __asan_loadN(uptr addr
, uptr size
) {
191 if (__asan_region_is_poisoned(addr
, size
)) {
193 ReportGenericError(pc
, bp
, sp
, addr
, false, size
, 0, true);
198 NOINLINE INTERFACE_ATTRIBUTE
199 void __asan_exp_loadN(uptr addr
, uptr size
, u32 exp
) {
200 if (__asan_region_is_poisoned(addr
, size
)) {
202 ReportGenericError(pc
, bp
, sp
, addr
, false, size
, exp
, true);
207 NOINLINE INTERFACE_ATTRIBUTE
208 void __asan_loadN_noabort(uptr addr
, uptr size
) {
209 if (__asan_region_is_poisoned(addr
, size
)) {
211 ReportGenericError(pc
, bp
, sp
, addr
, false, size
, 0, false);
216 NOINLINE INTERFACE_ATTRIBUTE
217 void __asan_storeN(uptr addr
, uptr size
) {
218 if (__asan_region_is_poisoned(addr
, size
)) {
220 ReportGenericError(pc
, bp
, sp
, addr
, true, size
, 0, true);
225 NOINLINE INTERFACE_ATTRIBUTE
226 void __asan_exp_storeN(uptr addr
, uptr size
, u32 exp
) {
227 if (__asan_region_is_poisoned(addr
, size
)) {
229 ReportGenericError(pc
, bp
, sp
, addr
, true, size
, exp
, true);
234 NOINLINE INTERFACE_ATTRIBUTE
235 void __asan_storeN_noabort(uptr addr
, uptr size
) {
236 if (__asan_region_is_poisoned(addr
, size
)) {
238 ReportGenericError(pc
, bp
, sp
, addr
, true, size
, 0, false);
242 // Force the linker to keep the symbols for various ASan interface functions.
243 // We want to keep those in the executable in order to let the instrumented
244 // dynamic libraries access the symbol even if it is not used by the executable
245 // itself. This should help if the build system is removing dead code at link
247 static NOINLINE
void force_interface_symbols() {
248 volatile int fake_condition
= 0; // prevent dead condition elimination.
249 // __asan_report_* functions are noreturn, so we need a switch to prevent
250 // the compiler from removing any of them.
252 switch (fake_condition
) {
253 case 1: __asan_report_load1(0); break;
254 case 2: __asan_report_load2(0); break;
255 case 3: __asan_report_load4(0); break;
256 case 4: __asan_report_load8(0); break;
257 case 5: __asan_report_load16(0); break;
258 case 6: __asan_report_load_n(0, 0); break;
259 case 7: __asan_report_store1(0); break;
260 case 8: __asan_report_store2(0); break;
261 case 9: __asan_report_store4(0); break;
262 case 10: __asan_report_store8(0); break;
263 case 11: __asan_report_store16(0); break;
264 case 12: __asan_report_store_n(0, 0); break;
265 case 13: __asan_report_exp_load1(0, 0); break;
266 case 14: __asan_report_exp_load2(0, 0); break;
267 case 15: __asan_report_exp_load4(0, 0); break;
268 case 16: __asan_report_exp_load8(0, 0); break;
269 case 17: __asan_report_exp_load16(0, 0); break;
270 case 18: __asan_report_exp_load_n(0, 0, 0); break;
271 case 19: __asan_report_exp_store1(0, 0); break;
272 case 20: __asan_report_exp_store2(0, 0); break;
273 case 21: __asan_report_exp_store4(0, 0); break;
274 case 22: __asan_report_exp_store8(0, 0); break;
275 case 23: __asan_report_exp_store16(0, 0); break;
276 case 24: __asan_report_exp_store_n(0, 0, 0); break;
277 case 25: __asan_register_globals(nullptr, 0); break;
278 case 26: __asan_unregister_globals(nullptr, 0); break;
279 case 27: __asan_set_death_callback(nullptr); break;
280 case 28: __asan_set_error_report_callback(nullptr); break;
281 case 29: __asan_handle_no_return(); break;
282 case 30: __asan_address_is_poisoned(nullptr); break;
283 case 31: __asan_poison_memory_region(nullptr, 0); break;
284 case 32: __asan_unpoison_memory_region(nullptr, 0); break;
285 case 34: __asan_before_dynamic_init(nullptr); break;
286 case 35: __asan_after_dynamic_init(); break;
287 case 36: __asan_poison_stack_memory(0, 0); break;
288 case 37: __asan_unpoison_stack_memory(0, 0); break;
289 case 38: __asan_region_is_poisoned(0, 0); break;
290 case 39: __asan_describe_address(0); break;
291 case 40: __asan_set_shadow_00(0, 0); break;
292 case 41: __asan_set_shadow_f1(0, 0); break;
293 case 42: __asan_set_shadow_f2(0, 0); break;
294 case 43: __asan_set_shadow_f3(0, 0); break;
295 case 44: __asan_set_shadow_f5(0, 0); break;
296 case 45: __asan_set_shadow_f8(0, 0); break;
301 static void asan_atexit() {
302 Printf("AddressSanitizer exit stats:\n");
303 __asan_print_accumulated_stats();
304 // Print AsanMappingProfile.
305 for (uptr i
= 0; i
< kAsanMappingProfileSize
; i
++) {
306 if (AsanMappingProfile
[i
] == 0) continue;
307 Printf("asan_mapping.h:%zd -- %zd\n", i
, AsanMappingProfile
[i
]);
311 static void InitializeHighMemEnd() {
312 #if !ASAN_FIXED_MAPPING
313 kHighMemEnd
= GetMaxUserVirtualAddress();
314 // Increase kHighMemEnd to make sure it's properly
315 // aligned together with kHighMemBeg:
316 kHighMemEnd
|= (GetMmapGranularity() << SHADOW_SCALE
) - 1;
317 #endif // !ASAN_FIXED_MAPPING
318 CHECK_EQ((kHighMemBeg
% GetMmapGranularity()), 0);
321 void PrintAddressSpaceLayout() {
323 Printf("|| `[%p, %p]` || HighMem ||\n",
324 (void*)kHighMemBeg
, (void*)kHighMemEnd
);
325 Printf("|| `[%p, %p]` || HighShadow ||\n",
326 (void*)kHighShadowBeg
, (void*)kHighShadowEnd
);
329 Printf("|| `[%p, %p]` || ShadowGap3 ||\n",
330 (void*)kShadowGap3Beg
, (void*)kShadowGap3End
);
331 Printf("|| `[%p, %p]` || MidMem ||\n",
332 (void*)kMidMemBeg
, (void*)kMidMemEnd
);
333 Printf("|| `[%p, %p]` || ShadowGap2 ||\n",
334 (void*)kShadowGap2Beg
, (void*)kShadowGap2End
);
335 Printf("|| `[%p, %p]` || MidShadow ||\n",
336 (void*)kMidShadowBeg
, (void*)kMidShadowEnd
);
338 Printf("|| `[%p, %p]` || ShadowGap ||\n",
339 (void*)kShadowGapBeg
, (void*)kShadowGapEnd
);
341 Printf("|| `[%p, %p]` || LowShadow ||\n",
342 (void*)kLowShadowBeg
, (void*)kLowShadowEnd
);
343 Printf("|| `[%p, %p]` || LowMem ||\n",
344 (void*)kLowMemBeg
, (void*)kLowMemEnd
);
346 Printf("MemToShadow(shadow): %p %p",
347 (void*)MEM_TO_SHADOW(kLowShadowBeg
),
348 (void*)MEM_TO_SHADOW(kLowShadowEnd
));
351 (void*)MEM_TO_SHADOW(kHighShadowBeg
),
352 (void*)MEM_TO_SHADOW(kHighShadowEnd
));
356 (void*)MEM_TO_SHADOW(kMidShadowBeg
),
357 (void*)MEM_TO_SHADOW(kMidShadowEnd
));
360 Printf("redzone=%zu\n", (uptr
)flags()->redzone
);
361 Printf("max_redzone=%zu\n", (uptr
)flags()->max_redzone
);
362 Printf("quarantine_size_mb=%zuM\n", (uptr
)flags()->quarantine_size_mb
);
363 Printf("thread_local_quarantine_size_kb=%zuK\n",
364 (uptr
)flags()->thread_local_quarantine_size_kb
);
365 Printf("malloc_context_size=%zu\n",
366 (uptr
)common_flags()->malloc_context_size
);
368 Printf("SHADOW_SCALE: %d\n", (int)SHADOW_SCALE
);
369 Printf("SHADOW_GRANULARITY: %d\n", (int)SHADOW_GRANULARITY
);
370 Printf("SHADOW_OFFSET: 0x%zx\n", (uptr
)SHADOW_OFFSET
);
371 CHECK(SHADOW_SCALE
>= 3 && SHADOW_SCALE
<= 7);
373 CHECK(kMidShadowBeg
> kLowShadowEnd
&&
374 kMidMemBeg
> kMidShadowEnd
&&
375 kHighShadowBeg
> kMidMemEnd
);
378 #if defined(__thumb__) && defined(__linux__)
379 #define START_BACKGROUND_THREAD_IN_ASAN_INTERNAL
382 #ifndef START_BACKGROUND_THREAD_IN_ASAN_INTERNAL
383 static bool UNUSED __local_asan_dyninit
= [] {
384 MaybeStartBackgroudThread();
385 SetSoftRssLimitExceededCallback(AsanSoftRssLimitExceededCallback
);
391 static void AsanInitInternal() {
392 if (LIKELY(asan_inited
)) return;
393 SanitizerToolName
= "AddressSanitizer";
394 CHECK(!asan_init_is_running
&& "ASan init calls itself!");
395 asan_init_is_running
= true;
399 // Initialize flags. This must be done early, because most of the
400 // initialization steps look at flags().
403 // Stop performing init at this point if we are being loaded via
404 // dlopen() and the platform supports it.
405 if (SANITIZER_SUPPORTS_INIT_FOR_DLOPEN
&& UNLIKELY(HandleDlopenInit())) {
406 asan_init_is_running
= false;
407 VReport(1, "AddressSanitizer init is being performed for dlopen().\n");
411 AsanCheckIncompatibleRT();
412 AsanCheckDynamicRTPrereqs();
413 AvoidCVE_2016_2143();
415 SetCanPoisonMemory(flags()->poison_heap
);
416 SetMallocContextSize(common_flags()->malloc_context_size
);
418 InitializePlatformExceptionHandlers();
420 InitializeHighMemEnd();
422 // Make sure we are not statically linked.
423 AsanDoesNotSupportStaticLinkage();
425 // Install tool-specific callbacks in sanitizer_common.
426 AddDieCallback(AsanDie
);
427 SetCheckUnwindCallback(CheckUnwind
);
428 SetPrintfAndReportCallback(AppendToErrorMessageBuffer
);
430 __sanitizer_set_report_path(common_flags()->log_path
);
432 __asan_option_detect_stack_use_after_return
=
433 flags()->detect_stack_use_after_return
;
435 __sanitizer::InitializePlatformEarly();
437 // Re-exec ourselves if we need to set additional env or command line args.
440 // Setup internal allocator callback.
441 SetLowLevelAllocateMinAlignment(SHADOW_GRANULARITY
);
442 SetLowLevelAllocateCallback(OnLowLevelAllocate
);
444 InitializeAsanInterceptors();
447 // Enable system log ("adb logcat") on Android.
448 // Doing this before interceptors are initialized crashes in:
449 // AsanInitInternal -> android_log_write -> __interceptor_strcmp
452 ReplaceSystemMalloc();
454 DisableCoreDumperIfNecessary();
456 InitializeShadowMemory();
458 AsanTSDInit(PlatformTSDDtor
);
459 InstallDeadlySignalHandlers(AsanOnDeadlySignal
);
461 AllocatorOptions allocator_options
;
462 allocator_options
.SetFrom(flags(), common_flags());
463 InitializeAllocator(allocator_options
);
465 #ifdef START_BACKGROUND_THREAD_IN_ASAN_INTERNAL
466 MaybeStartBackgroudThread();
467 SetSoftRssLimitExceededCallback(AsanSoftRssLimitExceededCallback
);
470 // On Linux AsanThread::ThreadStart() calls malloc() that's why asan_inited
471 // should be set to 1 prior to initializing the threads.
473 asan_init_is_running
= false;
478 InitializeCoverage(common_flags()->coverage
, common_flags()->coverage_dir
);
480 // Now that ASan runtime is (mostly) initialized, deactivate it if
481 // necessary, so that it can be re-activated when requested.
482 if (flags()->start_deactivated
)
488 // Create main thread.
489 AsanThread
*main_thread
= CreateMainThread();
490 CHECK_EQ(0, main_thread
->tid());
491 force_interface_symbols(); // no-op.
492 SanitizerInitializeUnwinder();
494 if (CAN_SANITIZE_LEAKS
) {
495 __lsan::InitCommonLsan();
496 if (common_flags()->detect_leaks
&& common_flags()->leak_check_at_exit
) {
497 if (flags()->halt_on_error
)
498 Atexit(__lsan::DoLeakCheck
);
500 Atexit(__lsan::DoRecoverableLeakCheckVoid
);
505 __ubsan::InitAsPlugin();
508 InitializeSuppressions();
510 if (CAN_SANITIZE_LEAKS
) {
511 // LateInitialize() calls dlsym, which can allocate an error string buffer
512 // in the TLS. Let's ignore the allocation to avoid reporting a leak.
513 __lsan::ScopedInterceptorDisabler disabler
;
514 Symbolizer::LateInitialize();
516 Symbolizer::LateInitialize();
519 VReport(1, "AddressSanitizer Init done\n");
521 if (flags()->sleep_after_init
) {
522 Report("Sleeping for %d second(s)\n", flags()->sleep_after_init
);
523 SleepForSeconds(flags()->sleep_after_init
);
527 // Initialize as requested from some part of ASan runtime library (interceptors,
529 void AsanInitFromRtl() {
534 // Initialize runtime in case it's LD_PRELOAD-ed into unsanitized executable
535 // (and thus normal initializers from .preinit_array or modules haven't run).
537 class AsanInitializer
{
544 static AsanInitializer asan_initializer
;
545 #endif // ASAN_DYNAMIC
547 void UnpoisonStack(uptr bottom
, uptr top
, const char *type
) {
548 static const uptr kMaxExpectedCleanupSize
= 64 << 20; // 64M
549 if (top
- bottom
> kMaxExpectedCleanupSize
) {
550 static bool reported_warning
= false;
551 if (reported_warning
)
553 reported_warning
= true;
555 "WARNING: ASan is ignoring requested __asan_handle_no_return: "
556 "stack type: %s top: %p; bottom %p; size: %p (%zd)\n"
557 "False positive error reports may follow\n"
559 "https://github.com/google/sanitizers/issues/189\n",
560 type
, top
, bottom
, top
- bottom
, top
- bottom
);
563 PoisonShadow(bottom
, RoundUpTo(top
- bottom
, SHADOW_GRANULARITY
), 0);
566 static void UnpoisonDefaultStack() {
569 if (AsanThread
*curr_thread
= GetCurrentThread()) {
571 const uptr page_size
= GetPageSizeCached();
572 top
= curr_thread
->stack_top();
573 bottom
= ((uptr
)&local_stack
- page_size
) & ~(page_size
- 1);
575 CHECK(!SANITIZER_FUCHSIA
);
576 // If we haven't seen this thread, try asking the OS for stack bounds.
577 uptr tls_addr
, tls_size
, stack_size
;
578 GetThreadStackAndTls(/*main=*/false, &bottom
, &stack_size
, &tls_addr
,
580 top
= bottom
+ stack_size
;
583 UnpoisonStack(bottom
, top
, "default");
586 static void UnpoisonFakeStack() {
587 AsanThread
*curr_thread
= GetCurrentThread();
590 FakeStack
*stack
= curr_thread
->get_fake_stack();
593 stack
->HandleNoReturn();
596 } // namespace __asan
598 // ---------------------- Interface ---------------- {{{1
599 using namespace __asan
;
601 void NOINLINE
__asan_handle_no_return() {
602 if (asan_init_is_running
)
605 if (!PlatformUnpoisonStacks())
606 UnpoisonDefaultStack();
611 extern "C" void *__asan_extra_spill_area() {
612 AsanThread
*t
= GetCurrentThread();
614 return t
->extra_spill_area();
617 void __asan_handle_vfork(void *sp
) {
618 AsanThread
*t
= GetCurrentThread();
620 uptr bottom
= t
->stack_bottom();
621 PoisonShadow(bottom
, (uptr
)sp
- bottom
, 0);
624 void NOINLINE
__asan_set_death_callback(void (*callback
)(void)) {
625 SetUserDieCallback(callback
);
628 // Initialize as requested from instrumented application code.
629 // We use this call as a trigger to wake up ASan from deactivated state.
635 void __asan_version_mismatch_check() {