Skip to content

Commit 2b8fc70

Browse files
tmlemanabonislawski
authored andcommitted
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 34e00a8 commit 2b8fc70

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)