From 1c783f663e81aeddd0d83de9864d17f725866f29 Mon Sep 17 00:00:00 2001 From: Tomasz Leman Date: Tue, 6 Oct 2026 17:07:05 +0200 Subject: [PATCH] platform: posix: clk: use the only registered clock index posix_clk_init() registers a single clock_info with a single frequency entry, but CPU_LPRO_FREQ_IDX / CPU_LOWEST_FREQ_IDX were defined as 1. basefw_config() passes CPU_LOWEST_FREQ_IDX to clock_get_freq(), which computes clocks_get() + 1 and reads one struct past the table: SEGV on unknown address 0x40b1fc80 (READ) #0 clock_get_freq src/lib/clk.c:48 #1 basefw_config src/audio/base_fw.c:163 Found by libFuzzer IPC4/ASan. Signed-off-by: Tomasz Leman --- src/platform/posix/include/platform/lib/clk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/posix/include/platform/lib/clk.h b/src/platform/posix/include/platform/lib/clk.h index 7d396330a0cb..a5d8066a027c 100644 --- a/src/platform/posix/include/platform/lib/clk.h +++ b/src/platform/posix/include/platform/lib/clk.h @@ -4,7 +4,7 @@ */ #define CLK_MAX_CPU_HZ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC -#define CPU_LPRO_FREQ_IDX 1 +#define CPU_LPRO_FREQ_IDX 0 #define CPU_LOWEST_FREQ_IDX CPU_LPRO_FREQ_IDX /* This is not a platform function, it's defined in src/lib/clk.c.