[PATCH 06/12] clk: samsung: exynos5260: Terminate PLL rate tables with sentinels

Lee Jones lee at kernel.org
Fri Nov 27 10:03:14 PST 2026


_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, pll2550_24mhz_tbl and pll2650_24mhz_tbl
both 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 both PLL rate tables.

Fixes: d39e55e06371 ("clk/exynos5260: add clock file for exynos5260")
Cc: stable at vger.kernel.org
Signed-off-by: Lee Jones <lee at kernel.org>
---
 drivers/clk/samsung/clk-exynos5260.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/samsung/clk-exynos5260.c b/drivers/clk/samsung/clk-exynos5260.c
index 0a5959823370..8417321c1202 100644
--- a/drivers/clk/samsung/clk-exynos5260.c
+++ b/drivers/clk/samsung/clk-exynos5260.c
@@ -59,6 +59,7 @@ static const struct samsung_pll_rate_table pll2550_24mhz_tbl[] __initconst = {
 	PLL_35XX_RATE(24 * MHZ, 266000000, 266, 3, 3),
 	PLL_35XX_RATE(24 * MHZ, 200000000, 200, 3, 3),
 	PLL_35XX_RATE(24 * MHZ, 160000000, 160, 3, 3),
+	{ /* sentinel */ }
 };
 
 /*
@@ -83,6 +84,7 @@ static const struct samsung_pll_rate_table pll2650_24mhz_tbl[] __initconst = {
 	PLL_36XX_RATE(24 * MHZ, 133000000, 266, 3, 4, 0),
 	PLL_36XX_RATE(24 * MHZ, 100000000, 200, 3, 4, 0),
 	PLL_36XX_RATE(24 * MHZ, 66000000, 176, 2, 5, 0),
+	{ /* sentinel */ }
 };
 
 /* CMU_AUD */
-- 
2.56.1.839.g22a8290db9-goog




More information about the linux-arm-kernel mailing list