mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-18 22:19:30 +02:00
Merge tag 'powerpc-7.3-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Madhavan Srinivasan:
"KVM:
- fix use-after-free in kvmhv_emulate_tlbie_all_lpid()
- fix secure device page leak on uv_page_in() failure
iommu:
- Fix the overflow validation in iommu_tce_check_ioba
Thanks to Amit Machhiwal, Gautam Menghani, Ritesh Harjani (IBM), R
Nageswara Sastry, and Shivaprasad G Bhat"
* tag 'powerpc-7.3-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/iommu: Fix the overflow validation in iommu_tce_check_ioba
KVM: PPC: Book3S HV: fix secure device page leak on uv_page_in() failure
KVM: PPC: Book3S HV: fix use-after-free in kvmhv_emulate_tlbie_all_lpid()
This commit is contained in:
@@ -1076,7 +1076,7 @@ int iommu_tce_check_ioba(unsigned long page_shift,
|
||||
if (ioba < offset)
|
||||
return -EINVAL;
|
||||
|
||||
if ((ioba + 1) > (offset + size))
|
||||
if ((ioba + npages < ioba) || (ioba - offset + npages > size))
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1204,8 +1204,10 @@ static void kvmhv_emulate_tlbie_all_lpid(struct kvm_vcpu *vcpu, int ric)
|
||||
|
||||
spin_lock(&kvm->mmu_lock);
|
||||
idr_for_each_entry(&kvm->arch.kvm_nested_guest_idr, gp, lpid) {
|
||||
++gp->refcnt;
|
||||
spin_unlock(&kvm->mmu_lock);
|
||||
kvmhv_emulate_tlbie_lpid(vcpu, gp, ric);
|
||||
kvmhv_put_nested(gp);
|
||||
spin_lock(&kvm->mmu_lock);
|
||||
}
|
||||
spin_unlock(&kvm->mmu_lock);
|
||||
|
||||
@@ -779,8 +779,11 @@ static int kvmppc_svm_page_in(struct vm_area_struct *vma,
|
||||
if (spage) {
|
||||
ret = uv_page_in(kvm->arch.lpid, pfn << page_shift,
|
||||
gpa, 0, page_shift);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
unlock_page(dpage);
|
||||
put_page(dpage);
|
||||
goto out_finalize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user