From: Greg Kroah-Hartman Date: Wed, 19 Nov 2014 16:58:37 +0000 (-0800) Subject: 3.14-stable patches X-Git-Tag: v3.10.61~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=84b599e5fb3dce648ea2a88e86b89d347f0b7c38;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch --- 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 index 00000000000..6581434905f --- /dev/null +++ b/queue-3.14/kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch @@ -0,0 +1,37 @@ +From a2b9e6c1a35afcc0973acb72e591c714e78885ff Mon Sep 17 00:00:00 2001 +From: Nadav Amit +Date: Wed, 17 Sep 2014 02:50:50 +0300 +Subject: KVM: x86: Don't report guest userspace emulation error to userspace + +From: Nadav Amit + +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 +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman + +--- + 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; diff --git a/queue-3.14/series b/queue-3.14/series index 68c6b1c1a7c..3ff044f11c7 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -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