]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Feb 2020 12:43:30 +0000 (13:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Feb 2020 12:43:30 +0000 (13:43 +0100)
added patches:
kvm-x86-free-wbinvd_dirty_mask-if-vcpu-creation-fails.patch

queue-4.14/kvm-x86-free-wbinvd_dirty_mask-if-vcpu-creation-fails.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/kvm-x86-free-wbinvd_dirty_mask-if-vcpu-creation-fails.patch b/queue-4.14/kvm-x86-free-wbinvd_dirty_mask-if-vcpu-creation-fails.patch
new file mode 100644 (file)
index 0000000..1fc9472
--- /dev/null
@@ -0,0 +1,37 @@
+From 16be9ddea268ad841457a59109963fff8c9de38d Mon Sep 17 00:00:00 2001
+From: Sean Christopherson <sean.j.christopherson@intel.com>
+Date: Wed, 18 Dec 2019 13:54:48 -0800
+Subject: KVM: x86: Free wbinvd_dirty_mask if vCPU creation fails
+
+From: Sean Christopherson <sean.j.christopherson@intel.com>
+
+commit 16be9ddea268ad841457a59109963fff8c9de38d upstream.
+
+Free the vCPU's wbinvd_dirty_mask if vCPU creation fails after
+kvm_arch_vcpu_init(), e.g. when installing the vCPU's file descriptor.
+Do the freeing by calling kvm_arch_vcpu_free() instead of open coding
+the freeing.  This adds a likely superfluous, but ultimately harmless,
+call to kvmclock_reset(), which only clears vcpu->arch.pv_time_enabled.
+Using kvm_arch_vcpu_free() allows for additional cleanup in the future.
+
+Fixes: f5f48ee15c2ee ("KVM: VMX: Execute WBINVD to keep data consistency with assigned devices")
+Cc: stable@vger.kernel.org
+Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
+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
+@@ -8063,7 +8063,7 @@ void kvm_arch_vcpu_destroy(struct kvm_vc
+       kvm_mmu_unload(vcpu);
+       vcpu_put(vcpu);
+-      kvm_x86_ops->vcpu_free(vcpu);
++      kvm_arch_vcpu_free(vcpu);
+ }
+ void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
index b63011109499ff733df1883382172dbb74d1727c..c4559820dae5b223cdd8acf7e059b21135f879b7 100644 (file)
@@ -88,3 +88,4 @@ kvm-x86-protect-x86_decode_insn-from-spectre-v1-l1tf-attacks.patch
 kvm-x86-protect-msr-based-index-computations-in-fixed_msr_to_seg_unit-from-spectre-v1-l1tf-attacks.patch
 kvm-ppc-book3s-hv-uninit-vcpu-if-vcore-creation-fails.patch
 kvm-ppc-book3s-pr-free-shared-page-if-mmu-initialization-fails.patch
+kvm-x86-free-wbinvd_dirty_mask-if-vcpu-creation-fails.patch