[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVkYUwYHOCtFb==YJ=1TK9+Tz1X=teaoyoooxe42eBYFw@mail.gmail.com>
Date: Mon, 19 Jan 2026 14:55:53 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Marek Vasut <marek.vasut+renesas@...lbox.org>
Cc: linux-clk@...r.kernel.org, stable@...r.kernel.org,
Michael Turquette <mturquette@...libre.com>, Stephen Boyd <sboyd@...nel.org>, linux-kernel@...r.kernel.org,
linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH] clk: rs9: Reserve 8 struct clk_hw slots for for 9FGV0841
Hi Marek,
On Sun, 18 Jan 2026 at 03:58, Marek Vasut
<marek.vasut+renesas@...lbox.org> wrote:
> The 9FGV0841 has 8 outputs and registers 8 struct clk_hw, make sure
> there are 8 slots for those newly registered clk_hw pointers, else
> there is going to be out of bounds write when pointers 4..7 are set
> into struct rs9_driver_data .clk_dif[4..7] field.
>
> Since there are other structure members past this struct clk_hw
> pointer array, writing to .clk_dif[4..7] fields only corrupts the
> struct rs9_driver_data content, without crashing the kernel. However,
I am not sure that is true. As the last 3 fields are just bytes, up to 3
pointers may be written outside the structure, which is 32 or 64 bytes large.
So any buffer overflow may corrupt another object from the 32-byte or
64-byte slab.
> the kernel does crash when the driver is unbound or during suspend.
>
> Fix this, increase the struct clk_hw pointer array size to the
> maximum output count of 9FGV0841, which is the biggest chip that
> is supported by this driver.
>
> Cc: stable@...r.kernel.org
> Fixes: f0e5e1800204 ("clk: rs9: Add support for 9FGV0841")
> Reported-by: Geert Uytterhoeven <geert+renesas@...der.be>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@...lbox.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
The crash I saw is gone, so:
Tested-by: Geert Uytterhoeven <geert+renesas@...der.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists