Skip to content

Commit a4d996c

Browse files
niklas88joergroedel
authored andcommitted
iommu/s390: Fix incorrect aperture check
The domain->geometry.aperture_end specifies the last valid address treat it as such when checking if a DMA address is valid. Reviewed-by: Pierre Morel <[email protected]> Reviewed-by: Matthew Rosato <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Signed-off-by: Niklas Schnelle <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent cbf7827 commit a4d996c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/s390-iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static int s390_iommu_update_trans(struct s390_domain *s390_domain,
213213
int rc = 0;
214214

215215
if (dma_addr < s390_domain->domain.geometry.aperture_start ||
216-
dma_addr + size > s390_domain->domain.geometry.aperture_end)
216+
(dma_addr + size - 1) > s390_domain->domain.geometry.aperture_end)
217217
return -EINVAL;
218218

219219
nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT;

0 commit comments

Comments
 (0)