From: Geert Uytterhoeven <geert@linux-m68k.org>
To: sashiko-reviews@lists.linux.dev
Cc: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org,
neil.armstrong@linaro.org, linux-hwmon@vger.kernel.org,
Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH treewide 4/5] iio: frequency: adf4377: Make sure clk_init_data is fully initialized
Date: Thu, 20 Aug 2026 09:40:35 +0200 [thread overview]
Message-ID: <CAMuHMdWpHicDvj7tvKJB7SCnVJ2gRmidUeTwA+hHxnhsXs7h=w@mail.gmail.com> (raw)
In-Reply-To: <20260819191316.8F2F21F000E9@smtp.kernel.org>
Hi Sashiko,
On Wed, 19 Aug 2026 at 21:13, <sashiko-bot@kernel.org> wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
>
> Pre-existing issues:
> - [High] Incomplete fix for uninitialized stack variables: `struct clk_parent_data parent_data` remains uninitialized on the stack, leading to a kernel crash during clock registration.
> --
>
> --- Patch [4]: [PATCH treewide 4/5] iio: frequency: adf4377: Make sure clk_init_data is fully initialized ---
> commit 99e024a77f5bce5921d3c6b46054263aa450610d
> Author: Geert Uytterhoeven <geert+renesas@glider.be>
>
> iio: frequency: adf4377: Make sure clk_init_data is fully initialized
>
> This commit initializes the clk_init_data structure in
> adf4377_clk_register() to zero. This prevents crashes caused by
> uninitialized fields like parent_names when CONFIG_INIT_STACK_ALL_PATTERN
> or CONFIG_INIT_STACK_NONE is enabled.
>
> > diff --git a/drivers/iio/frequency/adf4377.c b/drivers/iio/frequency/adf4377.c
> > --- a/drivers/iio/frequency/adf4377.c
> > +++ b/drivers/iio/frequency/adf4377.c
> > @@ -999,7 +999,7 @@ static int adf4377_clk_register(struct adf4377_state *st)
> > {
> > struct spi_device *spi = st->spi;
> > struct device *dev = &spi->dev;
> > - struct clk_init_data init;
> > + struct clk_init_data init = {};
> > struct clk_parent_data parent_data;
>
> [Severity: High]
> This is a pre-existing issue, but does this struct clk_parent_data also
> need to be zero-initialized?
>
> Only fw_name is explicitly assigned below, leaving name, hw, and index
> populated with stack garbage. When adf4377_clk_register() passes this to
> the clock framework, clk_core_populate_parent_map() will read
> parent_data.name and pass it to clk_cpy_name(), which ultimately calls
> strlen() and can cause a page fault during probe.
Yes, parent_data has the same issue.
As Jonathan will rebase against rc1 anyway, I will send a v2.
Thanks!
>
> [ ... ]
>
> > parent_data.fw_name = "ref_in";
> >
> > init.ops = &adf4377_clk_ops;
> > init.parent_data = &parent_data;
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787165329.git.geert+renesas@glider.be?part=4
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-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
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2026-08-20 7:40 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 19:05 [PATCH treewide 0/5] clk: Make sure clk_init_data is fully initialized (part 1) Geert Uytterhoeven
2026-08-19 19:05 ` [PATCH treewide 1/5] clk: ti: Make sure clk_init_data is fully initialized Geert Uytterhoeven
2026-08-19 19:10 ` sashiko-bot
2026-08-19 21:21 ` Brian Masney
2026-08-20 5:02 ` Mathieu Dubois-Briand
2026-08-20 5:56 ` Stephen Boyd
2026-08-19 19:05 ` [PATCH treewide 2/5] clk: visconti: " Geert Uytterhoeven
2026-08-19 19:14 ` sashiko-bot
2026-08-19 21:21 ` Brian Masney
2026-08-20 2:03 ` nobuhiro.iwamatsu.x90
2026-08-20 5:56 ` Stephen Boyd
2026-08-19 19:05 ` [PATCH treewide 3/5] hwmon: (ltc4282) " Geert Uytterhoeven
2026-08-19 19:12 ` sashiko-bot
2026-08-19 20:32 ` Guenter Roeck
2026-08-19 21:22 ` Brian Masney
2026-08-19 19:05 ` [PATCH treewide 4/5] iio: frequency: adf4377: " Geert Uytterhoeven
2026-08-19 19:13 ` sashiko-bot
2026-08-20 7:40 ` Geert Uytterhoeven [this message]
2026-08-19 21:22 ` Brian Masney
2026-08-20 1:38 ` Jonathan Cameron
2026-08-19 19:05 ` [PATCH treewide 5/5] spi: amlogic-spisg: " Geert Uytterhoeven
2026-08-19 19:13 ` sashiko-bot
2026-08-19 21:23 ` Brian Masney
2026-08-20 8:49 ` Xianwei Zhao
2026-08-20 12:11 ` (subset) [PATCH treewide 0/5] clk: Make sure clk_init_data is fully initialized (part 1) Mark Brown
2026-08-21 10:16 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMuHMdWpHicDvj7tvKJB7SCnVJ2gRmidUeTwA+hHxnhsXs7h=w@mail.gmail.com' \
--to=geert@linux-m68k.org \
--cc=jic23@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®