aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-02-18 05:14:59 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-15 12:07:11 -0400
commit8bc4cf28e87f4269773061bac06087c5efe1cc8b (patch)
tree88090ac4ef10820109e128ffeff9714a8b37020f
parent1c731613a9923eed0405f1abbc689e0a16add65a (diff)
KVM: x86 emulator: Forbid modifying CS segment register by mov instruction
commit 8b9f44140bc4afd2698413cd9960c3912168ee91 upstream. Inject #UD if guest attempts to do so. This is in accordance to Intel SDM. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--arch/x86/kvm/emulate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index f4e2a49513f1..3b9aca42cd30 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -1987,6 +1987,12 @@ special_insn:
1987 int err; 1987 int err;
1988 1988
1989 sel = c->src.val; 1989 sel = c->src.val;
1990
1991 if (c->modrm_reg == VCPU_SREG_CS) {
1992 kvm_queue_exception(ctxt->vcpu, UD_VECTOR);
1993 goto done;
1994 }
1995
1990 if (c->modrm_reg == VCPU_SREG_SS) 1996 if (c->modrm_reg == VCPU_SREG_SS)
1991 toggle_interruptibility(ctxt, X86_SHADOW_INT_MOV_SS); 1997 toggle_interruptibility(ctxt, X86_SHADOW_INT_MOV_SS);
1992 1998