x86/cpu: Avoid running off the end of an AMD erratum table
authorDave Hansen <dave.hansen@linux.intel.com>
Wed, 9 Apr 2025 13:58:37 +0000 (06:58 -0700)
committerDave Hansen <dave.hansen@linux.intel.com>
Wed, 9 Apr 2025 14:57:16 +0000 (07:57 -0700)
The NULL array terminator at the end of erratum_1386_microcode was
removed during the switch from x86_cpu_desc to x86_cpu_id. This
causes readers to run off the end of the array.

Replace the NULL.

Fixes: f3f325152673 ("x86/cpu: Move AMD erratum 1386 table over to 'x86_cpu_id'")
Reported-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
arch/x86/kernel/cpu/amd.c

index 79569f72b8ee5006297e1912209c426b472ec771..a839ff506f4548b342c853b0aaf4f262ed071be2 100644 (file)
@@ -805,6 +805,7 @@ static void init_amd_bd(struct cpuinfo_x86 *c)
 static const struct x86_cpu_id erratum_1386_microcode[] = {
        X86_MATCH_VFM_STEPS(VFM_MAKE(X86_VENDOR_AMD, 0x17, 0x01), 0x2, 0x2, 0x0800126e),
        X86_MATCH_VFM_STEPS(VFM_MAKE(X86_VENDOR_AMD, 0x17, 0x31), 0x0, 0x0, 0x08301052),
+       {}
 };
 
 static void fix_erratum_1386(struct cpuinfo_x86 *c)