Skip to content

Commit 0ea971f

Browse files
yanzhao56awilliam
authored andcommitted
vfio: avoid possible overflow in vfio_iommu_type1_pin_pages
add parentheses to avoid possible vaddr overflow. Fixes: a54eb55 ("vfio iommu type1: Add support for mediated devices") Signed-off-by: Yan Zhao <[email protected]> Signed-off-by: Alex Williamson <[email protected]>
1 parent 205323b commit 0ea971f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/vfio/vfio_iommu_type1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ static int vfio_iommu_type1_pin_pages(void *iommu_data,
555555
continue;
556556
}
557557

558-
remote_vaddr = dma->vaddr + iova - dma->iova;
558+
remote_vaddr = dma->vaddr + (iova - dma->iova);
559559
ret = vfio_pin_page_external(dma, remote_vaddr, &phys_pfn[i],
560560
do_accounting);
561561
if (ret)

0 commit comments

Comments
 (0)