Skip to content
Snippets Groups Projects
Commit 31ab12df authored by Boris Ostrovsky's avatar Boris Ostrovsky Committed by Borislav Petkov (AMD)
Browse files

x86/microcode/AMD: Fix __apply_microcode_amd()'s return value


When verify_sha256_digest() fails, __apply_microcode_amd() should propagate
the failure by returning false (and not -1 which is promoted to true).

Fixes: 50cef76d ("x86/microcode/AMD: Load only SHA256-checksummed patches")
Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250327230503.1850368-2-boris.ostrovsky@oracle.com
parent dc84bc2a
No related branches found
No related tags found
No related merge requests found
......@@ -600,7 +600,7 @@ static bool __apply_microcode_amd(struct microcode_amd *mc, u32 *cur_rev,
unsigned long p_addr = (unsigned long)&mc->hdr.data_code;
if (!verify_sha256_digest(mc->hdr.patch_id, *cur_rev, (const u8 *)p_addr, psize))
return -1;
return false;
native_wrmsrl(MSR_AMD64_PATCH_LOADER, p_addr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment