mirror of
https://github.com/raspberrypi/linux.git
synced 2026-01-04 18:27:36 +00:00
vfio: avoid possible overflow in vfio_iommu_type1_pin_pages
add parentheses to avoid possible vaddr overflow.
Fixes: a54eb55045 ("vfio iommu type1: Add support for mediated devices")
Signed-off-by: Yan Zhao <yan.y.zhao@intel.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
committed by
Alex Williamson
parent
205323b8ce
commit
0ea971f8dc
@@ -555,7 +555,7 @@ static int vfio_iommu_type1_pin_pages(void *iommu_data,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
remote_vaddr = dma->vaddr + iova - dma->iova;
|
remote_vaddr = dma->vaddr + (iova - dma->iova);
|
||||||
ret = vfio_pin_page_external(dma, remote_vaddr, &phys_pfn[i],
|
ret = vfio_pin_page_external(dma, remote_vaddr, &phys_pfn[i],
|
||||||
do_accounting);
|
do_accounting);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|||||||
Reference in New Issue
Block a user