Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
heap_kasan.h File Reference

Lightweight heap write address sanitizer (Heap KASAN) API. More...

#include <stdint.h>
#include <stddef.h>
#include <zephyr/sys/sys_heap.h>
#include <zephyr/sys/bitarray.h>
#include <zephyr/toolchain.h>
#include <zephyr/init.h>

Go to the source code of this file.

Macros

#define SYS_HEAP_KASAN_SHADOW_BITS(_sz)
 Shadow bits required for a heap of _sz bytes (one bit per granule).
#define SYS_HEAP_KASAN_SHADOW_BUNDLES(_sz)
 uint32_t bundle count for the shadow of a heap of _sz bytes.
#define SYS_HEAP_KASAN_ENABLE(_heap_name, _heap_sz)
 Enable KASAN shadow tracking on a struct sys_heap.
#define K_HEAP_KASAN_ENABLE(_heap_name, _heap_sz)
 Enable KASAN shadow tracking on a struct k_heap (K_HEAP_DEFINE).

Functions

void heap_kasan_report (uintptr_t addr, size_t size)
 Report a heap KASAN violation.
void heap_kasan_register (struct sys_heap *heap, sys_bitarray_t *ba)
 Associate a shadow bitarray with a heap for KASAN tracking.

Detailed Description

Lightweight heap write address sanitizer (Heap KASAN) API.