Skip to content

Commit 34e00a8

Browse files
tmlemanabonislawski
authored andcommitted
fuzz: Enable heap protection option
IPC fuzzer is built with Zephyr sys_heap. Because we have a custom allocator, the compiler sanitizers alone are not able to detect all errors related to memory allocation. Enabling heap hardening aims to increase the number of potentially detectable errors in fuzz builds. CONFIG_SYS_HEAP_HARDENING_EXTREME: adds per-chunk canary trailers (catching buffer overflows that spill even a single byte into the next chunk), double-free detection, free-list pointer validation, and a full heap structure walk after every alloc/free operation. This last check catches external corruption (e.g. a wild write from an unrelated component damaging heap metadata) before the allocator acts on it, rather than letting the damage propagate silently to the next allocation that happens to touch the corrupted region. The measured cost is ~7% throughput (288k -> 280k execs/30s), negligible given the class of bugs it surfaces. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent 1f4b8f0 commit 34e00a8

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

app/boards/native_sim_libfuzzer.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +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
89
CONFIG_ZEPHYR_NATIVE_DRIVERS=y
910
CONFIG_ARCH_POSIX_LIBFUZZER=y
1011
CONFIG_ZEPHYR_POSIX_FUZZ_TICKS=100

0 commit comments

Comments
 (0)