From: Thorsten Blum Date: Mon, 21 Apr 2025 18:31:08 +0000 (+0200) Subject: powerpc: Replace strcpy() with strscpy() in proc_ppc64_init() X-Git-Tag: v6.16-rc1~200^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e99a4a60d8fc9b24a3f9632011bf7e197f1aff9;p=thirdparty%2Fkernel%2Flinux.git powerpc: Replace strcpy() with strscpy() in proc_ppc64_init() strcpy() is deprecated; use strscpy() instead. Don't cast the destination buffer from 'u8[]' to 'char *' to satisfy the __must_be_array() requirement of strscpy(). No functional changes intended. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Thorsten Blum Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20250421183110.436265-1-thorsten.blum@linux.dev --- diff --git a/arch/powerpc/kernel/proc_powerpc.c b/arch/powerpc/kernel/proc_powerpc.c index 3816a2bf2b844..d083b45170658 100644 --- a/arch/powerpc/kernel/proc_powerpc.c +++ b/arch/powerpc/kernel/proc_powerpc.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -56,7 +57,7 @@ static int __init proc_ppc64_init(void) { struct proc_dir_entry *pde; - strcpy((char *)systemcfg->eye_catcher, "SYSTEMCFG:PPC64"); + strscpy(systemcfg->eye_catcher, "SYSTEMCFG:PPC64"); systemcfg->version.major = SYSTEMCFG_MAJOR; systemcfg->version.minor = SYSTEMCFG_MINOR; systemcfg->processor = mfspr(SPRN_PVR);