From: Greg Ungerer <gerg@linux-m68k.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
Thorsten Blum <thorsten.blum@linux.dev>
Cc: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>,
linux-hardening@vger.kernel.org, linux-m68k@lists.linux-m68k.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] m68k: mm: Replace deprecated strncpy() with strscpy()
Date: Wed, 19 Feb 2025 08:45:37 +1000 [thread overview]
Message-ID: <1fdb09f3-c228-45eb-99f8-fdbc8b4f9dcf@linux-m68k.org> (raw)
In-Reply-To: <CAMuHMdWFaudnOhwXpYJSwt3R909D8GLV+bLK7UhnH1Z3NB3ZsQ@mail.gmail.com>
Hi Thorsten,
On 19/2/25 00:13, Geert Uytterhoeven wrote:
> On Thu, 13 Feb 2025 at 15:11, Thorsten Blum <thorsten.blum@linux.dev> wrote:
>> strncpy() is deprecated for NUL-terminated destination buffers. Use
>> strscpy() instead and remove the manual NUL-termination.
>>
>> Compile-tested only.
>>
>> Link: https://github.com/KSPP/linux/issues/90
>> Cc: linux-hardening@vger.kernel.org
>> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
>
> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
>
>> --- a/arch/m68k/kernel/setup_mm.c
>> +++ b/arch/m68k/kernel/setup_mm.c
>> @@ -243,8 +243,7 @@ void __init setup_arch(char **cmdline_p)
>> setup_initial_init_mm((void *)PAGE_OFFSET, _etext, _edata, _end);
>>
>> #if defined(CONFIG_BOOTPARAM)
>> - strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE);
>> - m68k_command_line[CL_SIZE - 1] = 0;
>> + strscpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE);
>> #endif /* CONFIG_BOOTPARAM */
>> process_uboot_commandline(&m68k_command_line[0], CL_SIZE);
>> *cmdline_p = m68k_command_line;
>
> This seems to be used mostly by Coldfire, so I'll let Greg handle it.
Looks good. Pushed into the m68knommu git tree, for-next branch, with
JM's tested-by and Geert's reviewed-by added.
Thanks
Greg
next prev parent reply other threads:[~2025-02-18 22:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 14:10 [PATCH] m68k: mm: Replace deprecated strncpy() with strscpy() Thorsten Blum
2025-02-17 13:01 ` Jean-Michel Hautbois
2025-02-18 14:13 ` Geert Uytterhoeven
2025-02-18 22:45 ` Greg Ungerer [this message]
2025-02-20 2:21 ` Kees Cook
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=1fdb09f3-c228-45eb-99f8-fdbc8b4f9dcf@linux-m68k.org \
--to=gerg@linux-m68k.org \
--cc=geert@linux-m68k.org \
--cc=jeanmichel.hautbois@yoseli.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=thorsten.blum@linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).