#if KASAN
+#define KASAN_DEBUG 0
#define KASAN_KALLOC 1
#define KASAN_ZALLOC 1
#define KASAN_DYNAMIC_BLACKLIST 1
void kasan_notify_address_nopoison(vm_offset_t address, vm_size_t size);
void kasan_unpoison_stack(vm_offset_t stack, vm_size_t size);
void kasan_unpoison_curstack(bool whole_stack);
-void kasan_unpoison_fakestack(thread_t thread);
+bool kasan_check_shadow(vm_address_t base, vm_size_t sz, uint8_t shadow);
+void kasan_fakestack_drop(thread_t thread); /* mark all fakestack entries for thread as unused */
+void kasan_fakestack_gc(thread_t thread); /* free and poison all unused fakestack objects for thread */
void kasan_fakestack_suspend(void);
void kasan_fakestack_resume(void);
typedef int (*pmap_traverse_callback)(vm_map_offset_t start,
- vm_map_offset_t end,
- void *context);
+ vm_map_offset_t end,
+ void *context);
int kasan_traverse_mappings(pmap_traverse_callback, void *context);
#if XNU_KERNEL_PRIVATE
extern vm_offset_t shadow_pnext, shadow_ptop;
#endif
#endif
+
/*
* Allocator hooks
*/
__BEGIN_DECLS
-KASAN_DECLARE_FOREACH_WIDTH(void, __asan_report_load, uptr);
+ KASAN_DECLARE_FOREACH_WIDTH(void, __asan_report_load, uptr);
KASAN_DECLARE_FOREACH_WIDTH(void, __asan_report_store, uptr);
KASAN_DECLARE_FOREACH_WIDTH(void, __asan_store, uptr);
KASAN_DECLARE_FOREACH_WIDTH(void, __asan_report_exp_load, uptr, int32_t);