Address sanitization
include/mem/asan.h View source View on GitHubFunctions
Section titled “Functions”asan_init
Section titled “asan_init”void asan_init(void); asan_poison
Section titled “asan_poison”void asan_poison(void *addr, size_t size); asan_unpoison
Section titled “asan_unpoison”void asan_unpoison(void *addr, size_t size); Macros
Section titled “Macros”ASAN_SHADOW_SCALE
Section titled “ASAN_SHADOW_SCALE”#define ASAN_SHADOW_SCALE 3ULL /* 1 shadow byte per 8 real bytes */ ASAN_SHADOW_OFFSET
Section titled “ASAN_SHADOW_OFFSET”#define ASAN_SHADOW_OFFSET \
0xfffffc0000000000ULL /* fixed virtual base for shadow memory */ ASAN_REDZONE
Section titled “ASAN_REDZONE”#define ASAN_REDZONE 16 /* optional redzone per allocation */ ASAN_POISON_VALUE
Section titled “ASAN_POISON_VALUE”#define ASAN_POISON_VALUE 0xFF ASAN_ABORT_IF_NOT_READY
Section titled “ASAN_ABORT_IF_NOT_READY”#define ASAN_ABORT_IF_NOT_READY() \
do { \
if (!asan_ready) \
return; \
} while (0) asan_log
Section titled “asan_log”#define asan_log(lvl, fmt, ...) \
log(LOG_SITE(asan), LOG_HANDLE(asan), lvl, fmt, ##__VA_ARGS__) asan_err
Section titled “asan_err”#define asan_err(fmt, ...) asan_log(LOG_ERROR, fmt, ##__VA_ARGS__) asan_warn
Section titled “asan_warn”#define asan_warn(fmt, ...) asan_log(LOG_WARN, fmt, ##__VA_ARGS__) asan_info
Section titled “asan_info”#define asan_info(fmt, ...) asan_log(LOG_INFO, fmt, ##__VA_ARGS__) asan_debug
Section titled “asan_debug”#define asan_debug(fmt, ...) asan_log(LOG_DEBUG, fmt, ##__VA_ARGS__) asan_trace
Section titled “asan_trace”#define asan_trace(fmt, ...) asan_log(LOG_TRACE, fmt, ##__VA_ARGS__)