]>
Commit | Line | Data |
---|---|---|
aa62277d GKH |
1 | From 8b9f44140bc4afd2698413cd9960c3912168ee91 Mon Sep 17 00:00:00 2001 |
2 | From: Gleb Natapov <gleb@redhat.com> | |
3 | Date: Thu, 18 Feb 2010 12:14:59 +0200 | |
4 | Subject: KVM: x86 emulator: Forbid modifying CS segment register by mov instruction | |
5 | ||
6 | From: Gleb Natapov <gleb@redhat.com> | |
7 | ||
8 | commit 8b9f44140bc4afd2698413cd9960c3912168ee91 upstream. | |
9 | ||
10 | Inject #UD if guest attempts to do so. This is in accordance to Intel | |
11 | SDM. | |
12 | ||
13 | Signed-off-by: Gleb Natapov <gleb@redhat.com> | |
14 | Signed-off-by: Avi Kivity <avi@redhat.com> | |
15 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
16 | ||
17 | --- | |
18 | arch/x86/kvm/emulate.c | 6 ++++++ | |
19 | 1 file changed, 6 insertions(+) | |
20 | ||
21 | --- a/arch/x86/kvm/emulate.c | |
22 | +++ b/arch/x86/kvm/emulate.c | |
23 | @@ -1875,6 +1875,12 @@ special_insn: | |
24 | int err; | |
25 | ||
26 | sel = c->src.val; | |
27 | + | |
28 | + if (c->modrm_reg == VCPU_SREG_CS) { | |
29 | + kvm_queue_exception(ctxt->vcpu, UD_VECTOR); | |
30 | + goto done; | |
31 | + } | |
32 | + | |
33 | if (c->modrm_reg == VCPU_SREG_SS) | |
34 | toggle_interruptibility(ctxt, X86_SHADOW_INT_MOV_SS); | |
35 |