提交 e9064209 编写于 作者: Y Yan Zhao 提交者: Yang Yingliang

vfio: avoid possible overflow in vfio_iommu_type1_pin_pages

commit 0ea971f8 upstream.

add parentheses to avoid possible vaddr overflow.

Fixes: a54eb550 ("vfio iommu type1: Add support for mediated devices")
Signed-off-by: NYan Zhao <yan.y.zhao@intel.com>
Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 01d8e640
......@@ -602,7 +602,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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册