Skip to content

Commit 55bf4d8

Browse files
committed
fuzz: Enable stack sentinel for fuzz builds
Enable Zephyr stack sentinel checks for the native libFuzzer build. This complements the heap hardening option by catching Zephyr thread stack overflows closer to the corrupting input. CONFIG_STACK_SENTINEL: stores a magic value at the lowest addresses of each thread stack and checks it on context switch, interrupt return, k_yield(), and thread exit. When the sentinel is corrupted the system traps immediately, giving the fuzzer a clear crash signal instead of allowing silent corruption that manifests later in an unrelated path. This is particularly useful in UBSan-only fuzz runs where ASan stack redzones are not available. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent be2618f commit 55bf4d8

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
@@ -6,6 +6,7 @@ CONFIG_EXCEPTION_DEBUG=y
66
CONFIG_ARCH_POSIX_TRAP_ON_FATAL=y
77
CONFIG_SYS_HEAP_BIG_ONLY=y
88
CONFIG_SYS_HEAP_HARDENING_EXTREME=y
9+
CONFIG_STACK_SENTINEL=y
910
CONFIG_ZEPHYR_NATIVE_DRIVERS=y
1011
CONFIG_ARCH_POSIX_LIBFUZZER=y
1112
CONFIG_ZEPHYR_POSIX_FUZZ_TICKS=100

0 commit comments

Comments
 (0)