From: "tip-bot2 for XueBing Chen" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: XueBing Chen <chenxuebing@jari.cn>,
Ingo Molnar <mingo@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/boot] x86/setup: Use strscpy() to replace deprecated strlcpy()
Date: Wed, 25 May 2022 13:43:18 -0000 [thread overview]
Message-ID: <165348619853.4207.3379558582363552426.tip-bot2@tip-bot2> (raw)
In-Reply-To: <730f0fef.a33.180fa69880f.Coremail.chenxuebing@jari.cn>
The following commit has been merged into the x86/boot branch of tip:
Commit-ID: 8a33d96bd178d5f49cc5c1898e4cda08e221d2db
Gitweb: https://git.kernel.org/tip/8a33d96bd178d5f49cc5c1898e4cda08e221d2db
Author: XueBing Chen <chenxuebing@jari.cn>
AuthorDate: Wed, 25 May 2022 16:51:01 +08:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Wed, 25 May 2022 15:34:38 +02:00
x86/setup: Use strscpy() to replace deprecated strlcpy()
strlcpy() is marked deprecated and should not be used, because
it doesn't limit the source length.
The preferred interface for when strlcpy()'s return value is not
checked (truncation) is strscpy().
[ mingo: Tweaked the changelog ]
Signed-off-by: XueBing Chen <chenxuebing@jari.cn>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/730f0fef.a33.180fa69880f.Coremail.chenxuebing@jari.cn
---
arch/x86/kernel/setup.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 249981b..3ebb853 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -903,18 +903,18 @@ void __init setup_arch(char **cmdline_p)
#ifdef CONFIG_CMDLINE_BOOL
#ifdef CONFIG_CMDLINE_OVERRIDE
- strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
+ strscpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
#else
if (builtin_cmdline[0]) {
/* append boot loader cmdline to builtin */
strlcat(builtin_cmdline, " ", COMMAND_LINE_SIZE);
strlcat(builtin_cmdline, boot_command_line, COMMAND_LINE_SIZE);
- strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
+ strscpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
}
#endif
#endif
- strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
+ strscpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
*cmdline_p = command_line;
/*
prev parent reply other threads:[~2022-05-25 13:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-25 8:51 [PATCH] x86/setup: use strscpy to replace strlcpy XueBing Chen
2022-05-25 13:43 ` tip-bot2 for XueBing Chen [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=165348619853.4207.3379558582363552426.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=chenxuebing@jari.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=x86@kernel.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®