Skip to content

Commit 77eff95

Browse files
committed
x86/sev: Check for MWAITX and MONITORX opcodes in the #VC handler
jira VULN-756 cve-bf CVE-2024-25742 commit-author Tom Lendacky <[email protected]> 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 <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/453d5a7cfb4b9fe818b6fb67f93ae25468bc9e23.1713793161.git.thomas.lendacky@amd.com (cherry picked from commit e70316d) Signed-off-by: Marcin Wcisło <[email protected]>
1 parent 5104993 commit 77eff95

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
@@ -1026,12 +1026,14 @@ static enum es_result vc_check_opcode_bytes(struct es_em_ctxt *ctxt,
10261026
break;
10271027

10281028
case SVM_EXIT_MONITOR:
1029-
if (opcode == 0x010f && modrm == 0xc8)
1029+
/* MONITOR and MONITORX instructions generate the same error code */
1030+
if (opcode == 0x010f && (modrm == 0xc8 || modrm == 0xfa))
10301031
return ES_OK;
10311032
break;
10321033

10331034
case SVM_EXIT_MWAIT:
1034-
if (opcode == 0x010f && modrm == 0xc9)
1035+
/* MWAIT and MWAITX instructions generate the same error code */
1036+
if (opcode == 0x010f && (modrm == 0xc9 || modrm == 0xfb))
10351037
return ES_OK;
10361038
break;
10371039

0 commit comments

Comments
 (0)