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

ivaylo ivanov ivo.ivanov.ivanov1 at gmail.com
Sat Nov 28 05:38:44 PST 2026


On 11/27/26 22:03, Lee Jones wrote:
> _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")

Looks good to me. Thanks, nice catch!

Reviewed-by: Ivaylo Ivanov <ivo.ivanov.ivanov1 at gmail.com>

> Cc: stable at vger.kernel.org
> Signed-off-by: Lee Jones <lee at kernel.org>
> ---
>   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 */ }
>   };
>   

...

Best regards,
Ivaylo



More information about the linux-arm-kernel mailing list