mirror of
https://github.com/brain-hackers/linux-brain.git
synced 2024-06-09 23:36:23 +09:00
vfio: avoid possible overflow in vfio_iommu_type1_pin_pages
commit 0ea971f8dcd6dee78a9a30ea70227cf305f11ff7 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
751e8b062a
commit
f034b331ef
|
@ -598,7 +598,7 @@ static int vfio_iommu_type1_pin_pages(void *iommu_data,
|
|||
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],
|
||||
do_accounting);
|
||||
if (ret)
|
||||
|
|
Loading…
Reference in New Issue
Block a user