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

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

diff --git a/queue-3.17/kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch b/queue-3.17/kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch
new file mode 100644 (file)
index 0000000..dfe856b
--- /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
+@@ -5002,7 +5002,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 6bcc99dfe9db2bc8645fd021fec6846328e41f92..d60e11a44a1755702b5df03b32af1521e4099daa 100644 (file)
@@ -131,3 +131,4 @@ dell-wmi-fix-access-out-of-memory.patch
 builddeb-put-the-dbg-files-into-the-correct-directory.patch
 checkpatch-remove-unnecessary-after-8-8.patch
 mm-thp-fix-collapsing-of-hugepages-on-madvise.patch
+kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch