aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@linux.dev>2025-02-13 15:10:36 +0100
committerGreg Ungerer <gerg@kernel.org>2025-03-17 09:27:59 +1000
commita7130910b80753d52ff8a493cf787bd1c9473404 (patch)
treefd6de203d831d7e8c8f9def816a51b6854933ffe
parentm68k: Do not include <linux/fb.h> (diff)
downloadwireguard-linux-a7130910b80753d52ff8a493cf787bd1c9473404.tar.xz
wireguard-linux-a7130910b80753d52ff8a493cf787bd1c9473404.zip
m68k: mm: Replace deprecated strncpy() with strscpy()
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> Tested-by: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Kees Cook <kees@kernel.org> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
-rw-r--r--arch/m68k/kernel/setup_mm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
index 15c1a595a1de..48ce67947678 100644
--- 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;