X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=patches%2Fkernel%2F0012-x86-KVM-Clean-up-host-s-steal-time-structure.patch;fp=patches%2Fkernel%2F0012-x86-KVM-Clean-up-host-s-steal-time-structure.patch;h=0000000000000000000000000000000000000000;hb=6ad155377dfd50c63669037dbf565a3932ecc8bb;hp=1300b80997a39f6d8bf3fe4694afbeb246c6daa2;hpb=41e87bf3f0a4ed288e8a2da8570faa8cae3b65be;p=pve-kernel.git diff --git a/patches/kernel/0012-x86-KVM-Clean-up-host-s-steal-time-structure.patch b/patches/kernel/0012-x86-KVM-Clean-up-host-s-steal-time-structure.patch deleted file mode 100644 index 1300b80..0000000 --- a/patches/kernel/0012-x86-KVM-Clean-up-host-s-steal-time-structure.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Boris Ostrovsky -Date: Fri, 31 Jan 2020 08:06:44 -0300 -Subject: [PATCH] x86/KVM: Clean up host's steal time structure - -CVE-2019-3016 -CVE-2020-3016 - -Now that we are mapping kvm_steal_time from the guest directly we -don't need keep a copy of it in kvm_vcpu_arch.st. The same is true -for the stime field. - -This is part of CVE-2019-3016. - -Signed-off-by: Boris Ostrovsky -Reviewed-by: Joao Martins -Signed-off-by: Thadeu Lima de Souza Cascardo -Signed-off-by: Thomas Lamprecht ---- - arch/x86/include/asm/kvm_host.h | 3 +-- - arch/x86/kvm/x86.c | 11 +++-------- - 2 files changed, 4 insertions(+), 10 deletions(-) - -diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h -index 7c06343614a4..f62f4ff5f4f4 100644 ---- a/arch/x86/include/asm/kvm_host.h -+++ b/arch/x86/include/asm/kvm_host.h -@@ -674,10 +674,9 @@ struct kvm_vcpu_arch { - bool pvclock_set_guest_stopped_request; - - struct { -+ u8 preempted; - u64 msr_val; - u64 last_steal; -- struct gfn_to_hva_cache stime; -- struct kvm_steal_time steal; - struct gfn_to_pfn_cache cache; - } st; - -diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c -index 431e34965707..c059728f8a44 100644 ---- a/arch/x86/kvm/x86.c -+++ b/arch/x86/kvm/x86.c -@@ -2503,7 +2503,7 @@ static void record_steal_time(struct kvm_vcpu *vcpu) - if (xchg(&st->preempted, 0) & KVM_VCPU_FLUSH_TLB) - kvm_vcpu_flush_tlb(vcpu, false); - -- vcpu->arch.st.steal.preempted = 0; -+ vcpu->arch.st.preempted = 0; - - if (st->version & 1) - st->version += 1; /* first time write, random junk */ -@@ -2676,11 +2676,6 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) - if (data & KVM_STEAL_RESERVED_MASK) - return 1; - -- if (kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.st.stime, -- data & KVM_STEAL_VALID_BITS, -- sizeof(struct kvm_steal_time))) -- return 1; -- - vcpu->arch.st.msr_val = data; - - if (!(data & KVM_MSR_ENABLED)) -@@ -3398,7 +3393,7 @@ static void kvm_steal_time_set_preempted(struct kvm_vcpu *vcpu) - if (!(vcpu->arch.st.msr_val & KVM_MSR_ENABLED)) - return; - -- if (vcpu->arch.st.steal.preempted) -+ if (vcpu->arch.st.preempted) - return; - - if (kvm_map_gfn(vcpu, vcpu->arch.st.msr_val >> PAGE_SHIFT, &map, -@@ -3408,7 +3403,7 @@ static void kvm_steal_time_set_preempted(struct kvm_vcpu *vcpu) - st = map.hva + - offset_in_page(vcpu->arch.st.msr_val & KVM_STEAL_VALID_BITS); - -- st->preempted = vcpu->arch.st.steal.preempted = KVM_VCPU_PREEMPTED; -+ st->preempted = vcpu->arch.st.preempted = KVM_VCPU_PREEMPTED; - - kvm_unmap_gfn(vcpu, &map, &vcpu->arch.st.cache, true, true); - }