Commit 3e338f53 authored by Gleb Natapov's avatar Gleb Natapov Committed by Greg Kroah-Hartman

KVM: x86 emulator: Forbid modifying CS segment register by mov instruction

commit 8b9f4414 upstream.

Inject #UD if guest attempts to do so. This is in accordance to Intel
SDM.
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 89412b0b
......@@ -1875,6 +1875,12 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
int err;
sel = c->src.val;
if (c->modrm_reg == VCPU_SREG_CS) {
kvm_queue_exception(ctxt->vcpu, UD_VECTOR);
goto done;
}
if (c->modrm_reg == VCPU_SREG_SS)
toggle_interruptibility(ctxt, X86_SHADOW_INT_MOV_SS);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment