Commit 5e50df2d authored by Peter Xu's avatar Peter Xu Committed by Stefan Bader

KVM: MMU: drop vcpu param in gpte_access

It's never used.  Drop it.
Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>

CVE-2018-12207

(backported from commit 42522d08)
[tyhicks: Backport to 4.4
 - Considerable context differences due to code changes but nothing too
   complex]
Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent 3639763c
...@@ -181,7 +181,7 @@ static bool FNAME(prefetch_invalid_gpte)(struct kvm_vcpu *vcpu, ...@@ -181,7 +181,7 @@ static bool FNAME(prefetch_invalid_gpte)(struct kvm_vcpu *vcpu,
return true; return true;
} }
static inline unsigned FNAME(gpte_access)(struct kvm_vcpu *vcpu, u64 gpte) static inline unsigned FNAME(gpte_access)(u64 gpte)
{ {
unsigned access; unsigned access;
#if PTTYPE == PTTYPE_EPT #if PTTYPE == PTTYPE_EPT
...@@ -351,7 +351,7 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker, ...@@ -351,7 +351,7 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
} }
accessed_dirty &= pte; accessed_dirty &= pte;
pte_access = pt_access & FNAME(gpte_access)(vcpu, pte); pte_access = pt_access & FNAME(gpte_access)(pte);
walker->ptes[walker->level - 1] = pte; walker->ptes[walker->level - 1] = pte;
} while (!is_last_gpte(mmu, walker->level, pte)); } while (!is_last_gpte(mmu, walker->level, pte));
...@@ -464,7 +464,7 @@ FNAME(prefetch_gpte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp, ...@@ -464,7 +464,7 @@ FNAME(prefetch_gpte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
pgprintk("%s: gpte %llx spte %p\n", __func__, (u64)gpte, spte); pgprintk("%s: gpte %llx spte %p\n", __func__, (u64)gpte, spte);
gfn = gpte_to_gfn(gpte); gfn = gpte_to_gfn(gpte);
pte_access = sp->role.access & FNAME(gpte_access)(vcpu, gpte); pte_access = sp->role.access & FNAME(gpte_access)(gpte);
FNAME(protect_clean_gpte)(&pte_access, gpte); FNAME(protect_clean_gpte)(&pte_access, gpte);
pfn = pte_prefetch_gfn_to_pfn(vcpu, gfn, pfn = pte_prefetch_gfn_to_pfn(vcpu, gfn,
no_dirty_log && (pte_access & ACC_WRITE_MASK)); no_dirty_log && (pte_access & ACC_WRITE_MASK));
...@@ -947,7 +947,7 @@ static int FNAME(sync_page)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp) ...@@ -947,7 +947,7 @@ static int FNAME(sync_page)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
gfn = gpte_to_gfn(gpte); gfn = gpte_to_gfn(gpte);
pte_access = sp->role.access; pte_access = sp->role.access;
pte_access &= FNAME(gpte_access)(vcpu, gpte); pte_access &= FNAME(gpte_access)(gpte);
FNAME(protect_clean_gpte)(&pte_access, gpte); FNAME(protect_clean_gpte)(&pte_access, gpte);
if (sync_mmio_spte(vcpu, &sp->spt[i], gfn, pte_access, if (sync_mmio_spte(vcpu, &sp->spt[i], gfn, pte_access,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment