Skip to content

Commit 5ec09c6

Browse files
tmlemanlgirdwood
authored andcommitted
fuzz: enable sys_heap ASan poisoning and per-sanitizer hardening split
With CONFIG_SYS_HEAP_SANITIZER_ASAN enabled, freed and unallocated sys_heap regions are explicitly marked unaddressable via ASan's manual poisoning API. This gives ASan use-after-free and heap-buffer-overflow detection on all SOF dynamic memory (not just libc allocations that ASan tracks natively). Since poisoning supersedes the full-heap walk for corruption detection under ASan, downgrade the board-level default from EXTREME to FULL. Canaries (FULL) remain valuable: they catch overflows into the adjacent live chunk's trailer, a case that poisoning alone does not cover. For UBSan builds, which have no heap awareness at all, keep EXTREME in the sanitizer overlay so the full-walk remains the only proactive corruption detector. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent 2010ab0 commit 5ec09c6

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

app/boards/native_sim_libfuzzer.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CONFIG_ASSERT=y
55
CONFIG_EXCEPTION_DEBUG=y
66
CONFIG_ARCH_POSIX_TRAP_ON_FATAL=y
77
CONFIG_SYS_HEAP_BIG_ONLY=y
8-
CONFIG_SYS_HEAP_HARDENING_EXTREME=y
8+
CONFIG_SYS_HEAP_HARDENING_FULL=y
99
CONFIG_STACK_SENTINEL=y
1010
CONFIG_ZEPHYR_NATIVE_DRIVERS=y
1111
CONFIG_ARCH_POSIX_LIBFUZZER=y

app/configs/fuzz_asan.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
CONFIG_ASAN=y
2+
CONFIG_SYS_HEAP_SANITIZER_ASAN=y

app/configs/fuzz_ubsan.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
CONFIG_UBSAN=y
2+
CONFIG_SYS_HEAP_HARDENING_EXTREME=y

0 commit comments

Comments
 (0)