]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Nov 2014 16:58:37 +0000 (08:58 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Nov 2014 16:58:37 +0000 (08:58 -0800)
added patches:
kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch

queue-3.14/kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch [new file with mode: 0644]
queue-3.14/series

diff --git a/queue-3.14/kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch b/queue-3.14/kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch
new file mode 100644 (file)
index 0000000..6581434
--- /dev/null
@@ -0,0 +1,37 @@
+From a2b9e6c1a35afcc0973acb72e591c714e78885ff Mon Sep 17 00:00:00 2001
+From: Nadav Amit <namit@cs.technion.ac.il>
+Date: Wed, 17 Sep 2014 02:50:50 +0300
+Subject: KVM: x86: Don't report guest userspace emulation error to userspace
+
+From: Nadav Amit <namit@cs.technion.ac.il>
+
+commit a2b9e6c1a35afcc0973acb72e591c714e78885ff upstream.
+
+Commit fc3a9157d314 ("KVM: X86: Don't report L2 emulation failures to
+user-space") disabled the reporting of L2 (nested guest) emulation failures to
+userspace due to race-condition between a vmexit and the instruction emulator.
+The same rational applies also to userspace applications that are permitted by
+the guest OS to access MMIO area or perform PIO.
+
+This patch extends the current behavior - of injecting a #UD instead of
+reporting it to userspace - also for guest userspace code.
+
+Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kvm/x86.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kvm/x86.c
++++ b/arch/x86/kvm/x86.c
+@@ -4911,7 +4911,7 @@ static int handle_emulation_failure(stru
+       ++vcpu->stat.insn_emulation_fail;
+       trace_kvm_emulate_insn_failed(vcpu);
+-      if (!is_guest_mode(vcpu)) {
++      if (!is_guest_mode(vcpu) && kvm_x86_ops->get_cpl(vcpu) == 0) {
+               vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
+               vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION;
+               vcpu->run->internal.ndata = 0;
index 68c6b1c1a7c1c79950f94345aa0066247f233ebe..3ff044f11c789c935020b57d1e43d44eb440178f 100644 (file)
@@ -90,3 +90,4 @@ rcu-use-rcu_gp_kthread_wake-to-wake-up-grace-period-kthreads.patch
 dell-wmi-fix-access-out-of-memory.patch
 perf-handle-compat-ioctl.patch
 perf-x86-intel-use-proper-dtlb-load-misses-event-on-ivybridge.patch
+kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch