Skip to content

Commit 805b743

Browse files
bp3tk0vIngo Molnar
authored andcommitted
x86/microcode/AMD: Extend the SHA check to Zen5, block loading of any unreleased standalone Zen5 microcode patches
All Zen5 machines out there should get BIOS updates which update to the correct microcode patches addressing the microcode signature issue. However, silly people carve out random microcode blobs from BIOS packages and think are doing other people a service this way... Block loading of any unreleased standalone Zen5 microcode patches. Signed-off-by: Borislav Petkov (AMD) <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: <[email protected]> Cc: Andrew Cooper <[email protected]> Cc: Boris Ostrovsky <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Maciej S. Szmigiero <[email protected]> Cc: Nikolay Borisov <[email protected]> Cc: Tom Lendacky <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 164a9f7 commit 805b743

File tree

1 file changed

+7
-2
lines changed
  • arch/x86/kernel/cpu/microcode

1 file changed

+7
-2
lines changed

arch/x86/kernel/cpu/microcode/amd.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ static bool need_sha_check(u32 cur_rev)
199199
case 0xa70c0: return cur_rev <= 0xa70C009; break;
200200
case 0xaa001: return cur_rev <= 0xaa00116; break;
201201
case 0xaa002: return cur_rev <= 0xaa00218; break;
202+
case 0xb0021: return cur_rev <= 0xb002146; break;
203+
case 0xb1010: return cur_rev <= 0xb101046; break;
204+
case 0xb2040: return cur_rev <= 0xb204031; break;
205+
case 0xb4040: return cur_rev <= 0xb404031; break;
206+
case 0xb6000: return cur_rev <= 0xb600031; break;
207+
case 0xb7000: return cur_rev <= 0xb700031; break;
202208
default: break;
203209
}
204210

@@ -214,8 +220,7 @@ static bool verify_sha256_digest(u32 patch_id, u32 cur_rev, const u8 *data, unsi
214220
struct sha256_state s;
215221
int i;
216222

217-
if (x86_family(bsp_cpuid_1_eax) < 0x17 ||
218-
x86_family(bsp_cpuid_1_eax) > 0x19)
223+
if (x86_family(bsp_cpuid_1_eax) < 0x17)
219224
return true;
220225

221226
if (!need_sha_check(cur_rev))

0 commit comments

Comments
 (0)