From: Thorsten Blum <blum@kernel.org>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Mike Rapoport (Microsoft)" <rppt@kernel.org>,
Christian Brauner <brauner@kernel.org>,
Breno Leitao <leitao@debian.org>,
Ryan Roberts <ryan.roberts@arm.com>,
Sang-Heon Jeon <ekffu200098@gmail.com>,
Wilson Felipe Pereira <wfelipe@google.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] init: Use scnprintf() to simplify setup_command_line()
Date: Thu, 26 Nov 2026 22:40:32 +0100 [thread overview]
Message-ID: <awinUAUXoDboX9Gz@kernel.org> (raw)
In-Reply-To: <undine-1794960632051140078-b87135ce0906bd8f@undined.local>
Hi Masami,
On Wed, Nov 18, 2026 at 09:10:32AM +0900, Masami Hiramatsu (Google) wrote:
> On Wed, 18 Nov 2026 00:48:04 +0100, Thorsten Blum <blum@kernel.org> wrote:
> > strcpy() has been deprecated [1] because it performs no bounds checking
> > on the destination buffer, which can lead to buffer overflows.
> >
> > Use scnprintf() to format the saved and static command lines while
> > taking their buffer sizes into account. Use scnprintf()'s return value
> > to keep track of saved_command_line_len and avoid extra strlen() calls.
> >
> > No functional change.
> >
> > Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1]
> > Signed-off-by: Thorsten Blum <blum@kernel.org>
>
> Looks good to me. Let me pick this to bootconfig/core.
Have you applied this yet? I couldn't find it in the bootconfig/core
branch, which hasn't been updated in 5 years:
https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git/log/?h=bootconfig/core
Is there a different tree I should be looking at?
Thanks,
Thorsten
next prev parent reply other threads:[~2026-11-26 21:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 23:48 [PATCH] init: Use scnprintf() to simplify setup_command_line() Thorsten Blum
2026-11-18 0:10 ` Masami Hiramatsu (Google)
2026-11-26 21:40 ` Thorsten Blum [this message]
2026-11-18 10:30 ` David Laight
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=awinUAUXoDboX9Gz@kernel.org \
--to=blum@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=ekffu200098@gmail.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=wfelipe@google.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