projects
/
GitHub
/
mt8127
/
android_kernel_alcatel_ttab.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
70e335e
)
KVM: x86 emulator: Forbid modifying CS segment register by mov instruction
author
Gleb Natapov
<gleb@redhat.com>
Thu, 18 Feb 2010 10:14:59 +0000
(12:14 +0200)
committer
Marcelo Tosatti
<mtosatti@redhat.com>
Mon, 1 Mar 2010 15:36:13 +0000
(12:36 -0300)
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: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/emulate.c
patch
|
blob
|
blame
|
history
diff --git
a/arch/x86/kvm/emulate.c
b/arch/x86/kvm/emulate.c
index c280c2352f7e818ce2195ec48e9db974734a9eaa..2db760ff887c04a250ec2dde056f717dd3413716 100644
(file)
--- a/
arch/x86/kvm/emulate.c
+++ b/
arch/x86/kvm/emulate.c
@@
-2126,6
+2126,12
@@
special_insn:
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);