projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58b7075
)
KVM: x86: Sysexit emulation does not mask RIP/RSP
author
Nadav Amit
<namit@cs.technion.ac.il>
Thu, 18 Sep 2014 19:39:45 +0000
(22:39 +0300)
committer
Paolo Bonzini
<pbonzini@redhat.com>
Mon, 3 Nov 2014 11:07:21 +0000
(12:07 +0100)
If the operand size is not 64-bit, then the sysexit instruction should assign
ECX to RSP and EDX to RIP. The current code assigns the full 64-bits.
Fix it by masking.
Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@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 a90fa188aeea0f65e3460328f9ef013eb937b09c..058aff86cfba4e170f1c7587c5c3d4d68c6e71e3 100644
(file)
--- a/
arch/x86/kvm/emulate.c
+++ b/
arch/x86/kvm/emulate.c
@@
-2417,6
+2417,8
@@
static int em_sysexit(struct x86_emulate_ctxt *ctxt)
if ((msr_data & 0xfffc) == 0x0)
return emulate_gp(ctxt, 0);
ss_sel = (u16)(msr_data + 24);
+ rcx = (u32)rcx;
+ rdx = (u32)rdx;
break;
case X86EMUL_MODE_PROT64:
cs_sel = (u16)(msr_data + 32);