Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iommu: Do not return 0 from map_pages if it doesn't do anything
[ Upstream commit 6093cd5 ] These three implementations of map_pages() all succeed if a mapping is requested with no read or write. Since they return back to __iommu_map() leaving the mapped output as 0 it triggers an infinite loop. Therefore nothing is using no-access protection bits. Further, VFIO and iommufd rely on iommu_iova_to_phys() to get back PFNs stored by map, if iommu_map() succeeds but iommu_iova_to_phys() fails that will create serious bugs. Thus remove this never used "nothing to do" concept and just fail map immediately. Fixes: e5fc975 ("iommu/io-pgtable: Add ARMv7 short descriptor support") Fixes: e1d3c0f ("iommu: add ARM LPAE page table allocator") Fixes: 745ef10 ("iommu/io-pgtable: Move Apple DART support to its own file") Signed-off-by: Jason Gunthorpe <[email protected]> Acked-by: Will Deacon <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
- Loading branch information