From: Thorsten Blum <thorsten.blum@linux.dev>
To: Richard Henderson <richard.henderson@linaro.org>,
Matt Turner <mattst88@gmail.com>
Cc: linux-hardening@vger.kernel.org,
Thorsten Blum <thorsten.blum@linux.dev>,
linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH RESEND] alpha: Replace strcpy() with strscpy() in setup_arch()
Date: Mon, 18 Aug 2025 01:17:50 +0200 [thread overview]
Message-ID: <20250817231753.633899-1-thorsten.blum@linux.dev> (raw)
strcpy() is deprecated; use strscpy() instead.
Since the destination buffer 'command_line' has a fixed length,
strscpy() automatically determines its size using sizeof() when the size
argument is omitted. This makes the explicit size argument for the
existing strscpy() call unnecessary - remove it.
No functional changes intended.
Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
arch/alpha/kernel/setup.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index bebdffafaee8..8b51e6ca83d6 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -468,8 +468,8 @@ setup_arch(char **cmdline_p)
/*
* Locate the command line.
*/
- strscpy(command_line, COMMAND_LINE, sizeof(command_line));
- strcpy(boot_command_line, command_line);
+ strscpy(command_line, COMMAND_LINE);
+ strscpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
*cmdline_p = command_line;
/*
@@ -511,7 +511,7 @@ setup_arch(char **cmdline_p)
}
/* Replace the command line, now that we've killed it with strsep. */
- strcpy(command_line, boot_command_line);
+ strscpy(command_line, boot_command_line);
/* If we want SRM console printk echoing early, do it now. */
if (alpha_using_srm && srmcons_output) {
--
2.50.1
next reply other threads:[~2025-08-17 23:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-17 23:17 Thorsten Blum [this message]
2025-08-30 19:11 ` Magnus Lindholm
2025-09-08 13:23 ` Thorsten Blum
2025-09-09 8:04 ` Magnus Lindholm
-- strict thread matches above, loose matches on Subject: below --
2025-07-16 21:11 Thorsten Blum
2025-06-19 14:58 Thorsten Blum
2025-05-21 12:20 Thorsten Blum
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=20250817231753.633899-1-thorsten.blum@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mattst88@gmail.com \
--cc=richard.henderson@linaro.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
all inboxes | Powered by JetHome®