Skip to content

Commit 6345037

Browse files
committed
x86/sev: Check for MWAITX and MONITORX opcodes in the #VC handler
jira VULN-751 cve-bf CVE-2024-25742 commit-author Tom Lendacky <thomas.lendacky@amd.com> commit e70316d The MWAITX and MONITORX instructions generate the same #VC error code as the MWAIT and MONITOR instructions, respectively. Update the #VC handler opcode checking to also support the MWAITX and MONITORX opcodes. Fixes: e3ef461 ("x86/sev: Harden #VC instruction emulation somewhat") Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/453d5a7cfb4b9fe818b6fb67f93ae25468bc9e23.1713793161.git.thomas.lendacky@amd.com (cherry picked from commit e70316d) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 86eaf83 commit 6345037

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/x86/kernel/sev-shared.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,12 +562,14 @@ static enum es_result vc_check_opcode_bytes(struct es_em_ctxt *ctxt,
562562
break;
563563

564564
case SVM_EXIT_MONITOR:
565-
if (opcode == 0x010f && modrm == 0xc8)
565+
/* MONITOR and MONITORX instructions generate the same error code */
566+
if (opcode == 0x010f && (modrm == 0xc8 || modrm == 0xfa))
566567
return ES_OK;
567568
break;
568569

569570
case SVM_EXIT_MWAIT:
570-
if (opcode == 0x010f && modrm == 0xc9)
571+
/* MWAIT and MWAITX instructions generate the same error code */
572+
if (opcode == 0x010f && (modrm == 0xc9 || modrm == 0xfb))
571573
return ES_OK;
572574
break;
573575

0 commit comments

Comments
 (0)