From: Rasmus Villemoes <ravi@prevas.dk>
To: Ngo Luong Thanh Tra <ngotra27101996@gmail.com>
Cc: u-boot@lists.denx.de,
Ngo Luong Thanh Tra <S4210155@student.rmit.edu.au>,
Alexander Sverdlin <alexander.sverdlin@siemens.com>,
Casey Connolly <casey.connolly@linaro.org>,
Patrice Chotard <patrice.chotard@foss.st.com>,
Peng Fan <peng.fan@nxp.com>, Simon Glass <sjg@chromium.org>,
Tom Rini <trini@konsulko.com>, Yao Zi <me@ziyao.cc>
Subject: Re: [PATCH] common: cli_hush: fix console_buffer overflow on boot retry
Date: Tue, 21 Apr 2026 10:06:34 +0200 [thread overview]
Message-ID: <87a4uwn3ed.fsf@prevas.dk> (raw)
In-Reply-To: <20260421053511.84312-1-S4210155@student.rmit.edu.au> (Ngo Luong Thanh Tra's message of "Tue, 21 Apr 2026 12:35:08 +0700")
On Tue, Apr 21 2026, Ngo Luong Thanh Tra <ngotra27101996@gmail.com> wrote:
> Add const_strcpy() macro to linux/build_bug.h that enforces at
> compile time that the destination is a writable char array (not char *
> or const char *), the source is a string literal, and the source fits
> in the destination including the NUL terminator.
>
> Fix the console_buffer extern declaration in console.h to include the
> array size so sizeof(console_buffer) is valid at call sites.
>
> Replace unbounded strcpy() in cli_hush.c with const_strcpy().
>
> Fixes: 657e19f8f2dd ("cli_hush: support running bootcmd on boot retry")
>
> Changes in v4:
> - Rebased on top of current master (as requested by Tom Rini)
>
> Changes in v3:
> - Reject const char * destinations in const_strcpy() (Simon Glass)
>
> Signed-off-by: Ngo Luong Thanh Tra <S4210155@student.rmit.edu.au>
> ---
Hi Ngo
Please address the feedback I gave in
https://lore.kernel.org/u-boot/87zf3co6pz.fsf@prevas.dk/.
Also, two things on creating patches:
When you create a new version of a patch (or patch series), please use
"git format-patch -vX" where X is the version number. For the next one
that would be "-v5". Then git will use the subject prefix "[PATCH v5]"
instead of merely "[PATCH]", making it easier to distinguish the
different ones in one's inbox or on lore.kernel.org/u-boot.
Second, the informative "Changes in vX:" stuff should go below the ---,
as it is not part of the commit message and should not be part of the
permanent git history once the patch is accepted.
Rasmus
next prev parent reply other threads:[~2026-04-21 8:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 5:35 [PATCH] common: cli_hush: fix console_buffer overflow on boot retry Ngo Luong Thanh Tra
2026-04-21 8:06 ` Rasmus Villemoes [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-04-06 2:30 Ngo Luong Thanh Tra
2026-04-14 2:09 ` Tom Rini
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=87a4uwn3ed.fsf@prevas.dk \
--to=ravi@prevas.dk \
--cc=S4210155@student.rmit.edu.au \
--cc=alexander.sverdlin@siemens.com \
--cc=casey.connolly@linaro.org \
--cc=me@ziyao.cc \
--cc=ngotra27101996@gmail.com \
--cc=patrice.chotard@foss.st.com \
--cc=peng.fan@nxp.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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