[PATCH 10/12] clk: samsung: exynos8895: Terminate PLL rate tables with sentinels

From: Lee Jones

Date: Fri Nov 27 2026 - 13:05:50 EST


_samsung_clk_register_pll() sizes each PLL rate table by scanning until
it encounters an entry with .rate == 0, then copies the counted entries
into pll->rate_table. However, pll_shared0_rate_table,
pll_shared1_rate_table, pll_shared2_rate_table, pll_shared3_rate_table,
and pll_shared4_rate_table all omit a terminating zero sentinel, causing
out-of-bounds reads into adjacent read-only data and populating
pll->rate_table with bogus entries.

Append a sentinel entry to each of the 5 PLL rate tables.

Fixes: 9174fac3b302 ("clk: samsung: Introduce Exynos8895 clock driver")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
---
drivers/clk/samsung/clk-exynos8895.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/clk/samsung/clk-exynos8895.c b/drivers/clk/samsung/clk-exynos8895.c
index 259481c4276e..daf337f47e4f 100644
--- a/drivers/clk/samsung/clk-exynos8895.c
+++ b/drivers/clk/samsung/clk-exynos8895.c
@@ -478,22 +478,27 @@ static const unsigned long top_clk_regs[] __initconst = {

static const struct samsung_pll_rate_table pll_shared0_rate_table[] __initconst = {
PLL_35XX_RATE(26 * MHZ, 2132000000U, 328, 4, 0),
+ { /* sentinel */ }
};

static const struct samsung_pll_rate_table pll_shared1_rate_table[] __initconst = {
PLL_35XX_RATE(26 * MHZ, 1865500000U, 287, 4, 0),
+ { /* sentinel */ }
};

static const struct samsung_pll_rate_table pll_shared2_rate_table[] __initconst = {
PLL_35XX_RATE(26 * MHZ, 800000000U, 400, 13, 0),
+ { /* sentinel */ }
};

static const struct samsung_pll_rate_table pll_shared3_rate_table[] __initconst = {
PLL_35XX_RATE(26 * MHZ, 630000000U, 315, 13, 0),
+ { /* sentinel */ }
};

static const struct samsung_pll_rate_table pll_shared4_rate_table[] __initconst = {
PLL_35XX_RATE(26 * MHZ, 667333333U, 154, 6, 0),
+ { /* sentinel */ }
};

static const struct samsung_pll_clock top_pll_clks[] __initconst = {
--
2.56.1.839.g22a8290db9-goog