From: Ruben Wauters Date: Tue, 29 Apr 2025 23:03:59 +0000 (+0100) Subject: x86/CPU/AMD: Replace strcpy() with strscpy() X-Git-Tag: v6.16-rc1~194^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=003f144ca04621e598fc1c5c4ce0a851cddfe104;p=thirdparty%2Flinux.git x86/CPU/AMD: Replace strcpy() with strscpy() strcpy() is deprecated due to issues with bounds checking and overflows. Replace it with strscpy(). Signed-off-by: Ruben Wauters Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/20250429230710.54014-1-rubenru09@aol.com --- diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 2b36379ff675d..0feb717a3624b 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -643,7 +643,7 @@ static void init_amd_k8(struct cpuinfo_x86 *c) } if (!c->x86_model_id[0]) - strcpy(c->x86_model_id, "Hammer"); + strscpy(c->x86_model_id, "Hammer"); #ifdef CONFIG_SMP /*