From: Sascha Hauer <s.hauer@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH master 1/3] clk: at91: sama5d2: fix buffer overflow of clk parent_names
Date: Mon, 14 Sep 2020 15:19:07 +0200 [thread overview]
Message-ID: <20200914131907.GU4498@pengutronix.de> (raw)
In-Reply-To: <20200902131307.17613-1-a.fatoum@pengutronix.de>
On Wed, Sep 02, 2020 at 03:13:05PM +0200, Ahmad Fatoum wrote:
> The upstream implementation passes the clock's parent_names as an
> address of a local array to the core. That's ok because data contained
> in struct clk_init_data is duplicated and stored with a proper lifetime.
>
> We don't have that in barebox, so the clock providers themselves are
> responsible for allocating an array with suitable lifetime. Most at91
> clk drivers did this by having a fixed size array in the clock's private
> data struct.
>
> Since 47475fa5e0e1 ("clk: at91: add sama5d2 audio PLL support"), we are
> overflowing struct clk_programmable::parent_names on the sama5d2,
> because there it has 6 parents, while only space for 5 were allocated.
>
> Make the parent_names member of variable size to fix this and to avoid
> such errors in future.
>
> Fixes: 47475fa5e0e1 ("clk: at91: add sama5d2 audio PLL support")
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> drivers/clk/at91/clk-i2s-mux.c | 7 +++----
> drivers/clk/at91/clk-master.c | 7 +++----
> drivers/clk/at91/clk-programmable.c | 6 +++---
> drivers/clk/at91/clk-slow.c | 5 +++--
> drivers/clk/at91/clk-smd.c | 5 +++--
> drivers/clk/at91/clk-usb.c | 5 +++--
> drivers/clk/at91/sckc.c | 5 +++--
> 7 files changed, 21 insertions(+), 19 deletions(-)
Applied to master, thanks
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2020-09-14 13:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-02 13:13 Ahmad Fatoum
2020-09-02 13:13 ` [PATCH master 2/3] ARM: at91: fix link error when CONFIG_BOOTM=n Ahmad Fatoum
2020-09-02 13:13 ` [PATCH master 3/3] ARM: at91: sama5d27-giantboard: fix multi-image compatibility Ahmad Fatoum
2020-09-14 13:19 ` Sascha Hauer [this message]
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=20200914131907.GU4498@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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