From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: "Vincent Stehlé" <vincent.stehle@arm.com>, u-boot@lists.denx.de
Cc: "Vincent Stehlé" <vincent.stehle@arm.com>,
"Jassi Brar" <jaswinder.singh@linaro.org>,
"Marek Vasut" <marex@denx.de>,
"Masahisa Kojima" <kojima.masahisa@socionext.com>,
"Michal Simek" <michal.simek@amd.com>,
"Patrice Chotard" <patrice.chotard@foss.st.com>,
"Patrick Delaunay" <patrick.delaunay@foss.st.com>,
"Tom Rini" <trini@konsulko.com>
Subject: Re: [PATCH 1/5] fwu: developerbox: fix dfu alt buffer clearing
Date: Mon, 14 Apr 2025 14:22:28 +0200 [thread overview]
Message-ID: <87sembc4qj.fsf@kernel.org> (raw)
In-Reply-To: <20250407170529.893307-2-vincent.stehle@arm.com>
Hi Vincent,
Thank you for the patch.
On lun., avril 07, 2025 at 19:05, Vincent Stehlé <vincent.stehle@arm.com> wrote:
> The set_dfu_alt_info() function calls the ALLOC_CACHE_ALIGN_BUFFER()
> macro to declare a `buf' variable pointer into an array allocated on the
> stack. It then calls the memset() function to clear the useable portion
> of the array using the idiomatic expression `sizeof(buf)'.
>
> While this would indeed work fine for an array, in the present case we
> end up clearing only the size of a pointer.
> Fix this by specifying the explicit size `DFU_ALT_BUF_LEN' instead.
>
> Fixes: 6b403ca4dcf4 ("fwu: DeveloperBox: add support for FWU")
> Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
> Cc: Masahisa Kojima <kojima.masahisa@socionext.com>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: Jassi Brar <jaswinder.singh@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
> board/socionext/developerbox/fwu_plat.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/board/socionext/developerbox/fwu_plat.c b/board/socionext/developerbox/fwu_plat.c
> index 26031795b09..a8b111477ef 100644
> --- a/board/socionext/developerbox/fwu_plat.c
> +++ b/board/socionext/developerbox/fwu_plat.c
> @@ -18,7 +18,7 @@ void set_dfu_alt_info(char *interface, char *devstr)
> struct mtd_info *mtd;
> int ret;
>
> - memset(buf, 0, sizeof(buf));
> + memset(buf, 0, DFU_ALT_BUF_LEN);
>
> mtd_probe_devices();
>
> --
> 2.47.2
next prev parent reply other threads:[~2025-04-14 12:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 17:05 [PATCH 0/5] fix dfu alt buffer clearing Vincent Stehlé
2025-04-07 17:05 ` [PATCH 1/5] fwu: developerbox: " Vincent Stehlé
2025-04-14 12:22 ` Mattijs Korpershoek [this message]
2025-04-07 17:05 ` [PATCH 2/5] board: st: common: " Vincent Stehlé
2025-04-14 12:24 ` Mattijs Korpershoek
2025-04-14 12:35 ` Mattijs Korpershoek
2025-04-22 7:32 ` Patrice CHOTARD
2025-05-05 13:28 ` Patrice CHOTARD
2025-04-07 17:05 ` [PATCH 3/5] arm64: versal: " Vincent Stehlé
2025-04-11 3:56 ` Begari, Padmarao
2025-04-14 6:28 ` Michal Simek
2025-04-07 17:05 ` [PATCH 4/5] xilinx: zynq: " Vincent Stehlé
2025-04-11 3:57 ` Begari, Padmarao
2025-04-14 6:28 ` Michal Simek
2025-04-07 17:05 ` [PATCH 5/5] arm64: zynqmp: " Vincent Stehlé
2025-04-11 3:57 ` Begari, Padmarao
2025-04-14 6:29 ` Michal Simek
2025-04-23 7:53 ` (subset) [PATCH 0/5] " Mattijs Korpershoek
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=87sembc4qj.fsf@kernel.org \
--to=mkorpershoek@kernel.org \
--cc=jaswinder.singh@linaro.org \
--cc=kojima.masahisa@socionext.com \
--cc=marex@denx.de \
--cc=michal.simek@amd.com \
--cc=patrice.chotard@foss.st.com \
--cc=patrick.delaunay@foss.st.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=vincent.stehle@arm.com \
/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