Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b9f4414 authored by Gleb Natapov's avatar Gleb Natapov Committed by Marcelo Tosatti
Browse files

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



Inject #UD if guest attempts to do so. This is in accordance to Intel
SDM.

Cc: stable@kernel.org (2.6.33, 2.6.32)
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 70e335e1
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2126,6 +2126,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);