Message ID | 20231201131601.1146971-3-magali.lemes@canonical.com |
---|---|
State | New |
Headers | show |
Series | [SRU,Lunar/Mantic/OEM-6.5,1/3] x86/sev: Disable MMIO emulation from user mode | expand |
diff --git a/arch/x86/kernel/sev.c b/arch/x86/kernel/sev.c index 45ef3926381f..b09172592e02 100644 --- a/arch/x86/kernel/sev.c +++ b/arch/x86/kernel/sev.c @@ -1552,6 +1552,9 @@ static enum es_result vc_handle_mmio(struct ghcb *ghcb, struct es_em_ctxt *ctxt) return ES_DECODE_FAILED; } + if (user_mode(ctxt->regs)) + return ES_UNSUPPORTED; + switch (mmio) { case INSN_MMIO_WRITE: memcpy(ghcb->shared_buffer, reg_data, bytes);