003 File Manager
Current Path:
/usr/src/contrib/llvm-project/compiler-rt/lib/asan
usr
/
src
/
contrib
/
llvm-project
/
compiler-rt
/
lib
/
asan
/
📁
..
📄
README.txt
(924 B)
📄
asan.syms.extra
(39 B)
📄
asan_activation.cpp
(4.55 KB)
📄
asan_activation.h
(736 B)
📄
asan_activation_flags.inc
(1.42 KB)
📄
asan_allocator.cpp
(40.63 KB)
📄
asan_allocator.h
(8.05 KB)
📄
asan_blacklist.txt
(513 B)
📄
asan_debugging.cpp
(4.7 KB)
📄
asan_descriptions.cpp
(16.44 KB)
📄
asan_descriptions.h
(7.59 KB)
📄
asan_errors.cpp
(21.78 KB)
📄
asan_errors.h
(14.75 KB)
📄
asan_fake_stack.cpp
(10.82 KB)
📄
asan_fake_stack.h
(6.89 KB)
📄
asan_flags.cpp
(7.32 KB)
📄
asan_flags.h
(1.45 KB)
📄
asan_flags.inc
(7.92 KB)
📄
asan_fuchsia.cpp
(8.18 KB)
📄
asan_globals.cpp
(16.98 KB)
📄
asan_globals_win.cpp
(2.03 KB)
📄
asan_init_version.h
(1.88 KB)
📄
asan_interceptors.cpp
(23.89 KB)
📄
asan_interceptors.h
(4.86 KB)
📄
asan_interceptors_memintrinsics.cpp
(1.52 KB)
📄
asan_interceptors_memintrinsics.h
(8.12 KB)
📄
asan_interceptors_vfork.S
(526 B)
📄
asan_interface.inc
(7.25 KB)
📄
asan_interface_internal.h
(10.88 KB)
📄
asan_internal.h
(5.95 KB)
📄
asan_linux.cpp
(7.45 KB)
📄
asan_lock.h
(0 B)
📄
asan_mac.cpp
(11.64 KB)
📄
asan_malloc_linux.cpp
(9.8 KB)
📄
asan_malloc_local.h
(1.92 KB)
📄
asan_malloc_mac.cpp
(3.83 KB)
📄
asan_malloc_win.cpp
(19.55 KB)
📄
asan_mapping.h
(14.72 KB)
📄
asan_mapping_myriad.h
(2.11 KB)
📄
asan_mapping_sparc64.h
(2.95 KB)
📄
asan_memory_profile.cpp
(4.12 KB)
📄
asan_new_delete.cpp
(8.16 KB)
📄
asan_poisoning.cpp
(16 KB)
📄
asan_poisoning.h
(3.85 KB)
📄
asan_posix.cpp
(4.12 KB)
📄
asan_preinit.cpp
(1 KB)
📄
asan_premap_shadow.cpp
(2.7 KB)
📄
asan_premap_shadow.h
(913 B)
📄
asan_report.cpp
(20.2 KB)
📄
asan_report.h
(4.59 KB)
📄
asan_rtems.cpp
(8.9 KB)
📄
asan_rtl.cpp
(22.99 KB)
📄
asan_scariness_score.h
(2.25 KB)
📄
asan_shadow_setup.cpp
(6.2 KB)
📄
asan_stack.cpp
(2.28 KB)
📄
asan_stack.h
(3.29 KB)
📄
asan_stats.cpp
(5.62 KB)
📄
asan_stats.h
(2.05 KB)
📄
asan_suppressions.cpp
(3.62 KB)
📄
asan_suppressions.h
(1.01 KB)
📄
asan_thread.cpp
(18.01 KB)
📄
asan_thread.h
(5.56 KB)
📄
asan_win.cpp
(13.74 KB)
📄
asan_win_dll_thunk.cpp
(5.12 KB)
📄
asan_win_dynamic_runtime_thunk.cpp
(5.4 KB)
📄
asan_win_weak_interception.cpp
(1.14 KB)
📄
weak_symbols.txt
(268 B)
Editing: asan_internal.h
//===-- asan_internal.h -----------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan-private header which defines various general utilities. //===----------------------------------------------------------------------===// #ifndef ASAN_INTERNAL_H #define ASAN_INTERNAL_H #include "asan_flags.h" #include "asan_interface_internal.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "sanitizer_common/sanitizer_libc.h" #if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) # error "The AddressSanitizer run-time should not be" " instrumented by AddressSanitizer" #endif // Build-time configuration options. // If set, asan will intercept C++ exception api call(s). #ifndef ASAN_HAS_EXCEPTIONS # define ASAN_HAS_EXCEPTIONS 1 #endif // If set, values like allocator chunk size, as well as defaults for some flags // will be changed towards less memory overhead. #ifndef ASAN_LOW_MEMORY # if SANITIZER_IOS || SANITIZER_ANDROID || SANITIZER_RTEMS # define ASAN_LOW_MEMORY 1 # else # define ASAN_LOW_MEMORY 0 # endif #endif #ifndef ASAN_DYNAMIC # ifdef PIC # define ASAN_DYNAMIC 1 # else # define ASAN_DYNAMIC 0 # endif #endif // All internal functions in asan reside inside the __asan namespace // to avoid namespace collisions with the user programs. // Separate namespace also makes it simpler to distinguish the asan run-time // functions from the instrumented user code in a profile. namespace __asan { class AsanThread; using __sanitizer::StackTrace; void AsanInitFromRtl(); // asan_win.cpp void InitializePlatformExceptionHandlers(); // Returns whether an address is a valid allocated system heap block. // 'addr' must point to the beginning of the block. bool IsSystemHeapAddress(uptr addr); // asan_rtl.cpp void PrintAddressSpaceLayout(); void NORETURN ShowStatsAndAbort(); // asan_shadow_setup.cpp void InitializeShadowMemory(); // asan_malloc_linux.cpp / asan_malloc_mac.cpp void ReplaceSystemMalloc(); // asan_linux.cpp / asan_mac.cpp / asan_rtems.cpp / asan_win.cpp uptr FindDynamicShadowStart(); void *AsanDoesNotSupportStaticLinkage(); void AsanCheckDynamicRTPrereqs(); void AsanCheckIncompatibleRT(); // Unpoisons platform-specific stacks. // Returns true if all stacks have been unpoisoned. bool PlatformUnpoisonStacks(); // asan_rtl.cpp // Unpoison a region containing a stack. // Performs a sanity check and warns if the bounds don't look right. // The warning contains the type string to identify the stack type. void UnpoisonStack(uptr bottom, uptr top, const char *type); // asan_thread.cpp AsanThread *CreateMainThread(); // Support function for __asan_(un)register_image_globals. Searches for the // loaded image containing `needle' and then enumerates all global metadata // structures declared in that image, applying `op' (e.g., // __asan_(un)register_globals) to them. typedef void (*globals_op_fptr)(__asan_global *, uptr); void AsanApplyToGlobals(globals_op_fptr op, const void *needle); void AsanOnDeadlySignal(int, void *siginfo, void *context); void ReadContextStack(void *context, uptr *stack, uptr *ssize); void StopInitOrderChecking(); // Wrapper for TLS/TSD. void AsanTSDInit(void (*destructor)(void *tsd)); void *AsanTSDGet(); void AsanTSDSet(void *tsd); void PlatformTSDDtor(void *tsd); void AppendToErrorMessageBuffer(const char *buffer); void *AsanDlSymNext(const char *sym); void ReserveShadowMemoryRange(uptr beg, uptr end, const char *name); // Returns `true` iff most of ASan init process should be skipped due to the // ASan library being loaded via `dlopen()`. Platforms may perform any // `dlopen()` specific initialization inside this function. bool HandleDlopenInit(); // Add convenient macro for interface functions that may be represented as // weak hooks. #define ASAN_MALLOC_HOOK(ptr, size) \ do { \ if (&__sanitizer_malloc_hook) __sanitizer_malloc_hook(ptr, size); \ RunMallocHooks(ptr, size); \ } while (false) #define ASAN_FREE_HOOK(ptr) \ do { \ if (&__sanitizer_free_hook) __sanitizer_free_hook(ptr); \ RunFreeHooks(ptr); \ } while (false) #define ASAN_ON_ERROR() \ if (&__asan_on_error) __asan_on_error() extern int asan_inited; // Used to avoid infinite recursion in __asan_init(). extern bool asan_init_is_running; extern void (*death_callback)(void); // These magic values are written to shadow for better error reporting. const int kAsanHeapLeftRedzoneMagic = 0xfa; const int kAsanHeapFreeMagic = 0xfd; const int kAsanStackLeftRedzoneMagic = 0xf1; const int kAsanStackMidRedzoneMagic = 0xf2; const int kAsanStackRightRedzoneMagic = 0xf3; const int kAsanStackAfterReturnMagic = 0xf5; const int kAsanInitializationOrderMagic = 0xf6; const int kAsanUserPoisonedMemoryMagic = 0xf7; const int kAsanContiguousContainerOOBMagic = 0xfc; const int kAsanStackUseAfterScopeMagic = 0xf8; const int kAsanGlobalRedzoneMagic = 0xf9; const int kAsanInternalHeapMagic = 0xfe; const int kAsanArrayCookieMagic = 0xac; const int kAsanIntraObjectRedzone = 0xbb; const int kAsanAllocaLeftMagic = 0xca; const int kAsanAllocaRightMagic = 0xcb; // Used to populate the shadow gap for systems without memory // protection there (i.e. Myriad). const int kAsanShadowGap = 0xcc; static const uptr kCurrentStackFrameMagic = 0x41B58AB3; static const uptr kRetiredStackFrameMagic = 0x45E0360E; } // namespace __asan #endif // ASAN_INTERNAL_H
Upload File
Create Folder