]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/CPU/AMD: Replace strcpy() with strscpy()
authorRuben Wauters <rubenru09@aol.com>
Tue, 29 Apr 2025 23:03:59 +0000 (00:03 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 30 Apr 2025 17:32:36 +0000 (19:32 +0200)
strcpy() is deprecated due to issues with bounds checking and overflows.
Replace it with strscpy().

Signed-off-by: Ruben Wauters <rubenru09@aol.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/20250429230710.54014-1-rubenru09@aol.com
arch/x86/kernel/cpu/amd.c

index 2b36379ff675dc9b4fbca5f73dd183cb3bc93340..0feb717a3624b608e86b8ee946120701faa958c7 100644 (file)
@@ -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
        /*