diff options
author | Niklas Schnelle <schnelle@linux.ibm.com> | 2022-10-25 14:56:55 +0300 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2022-11-03 17:40:54 +0300 |
commit | a4d996c2c4b55a42b21d0f7026b2bd6f7396f666 (patch) | |
tree | f560a74306af84087997bfe3ec27fc3da9b7a4e1 | |
parent | cbf7827bc5dcfa4301aaea6f57eba9a94dbee7b1 (diff) | |
download | linux-a4d996c2c4b55a42b21d0f7026b2bd6f7396f666.tar.xz |
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 <pmorel@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Link: https://lore.kernel.org/r/20221025115657.1666860-5-schnelle@linux.ibm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r-- | drivers/iommu/s390-iommu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c index 9b3adc61005c..3e601ca6ee0f 100644 --- a/drivers/iommu/s390-iommu.c +++ b/drivers/iommu/s390-iommu.c @@ -213,7 +213,7 @@ static int s390_iommu_update_trans(struct s390_domain *s390_domain, int rc = 0; if (dma_addr < s390_domain->domain.geometry.aperture_start || - dma_addr + size > s390_domain->domain.geometry.aperture_end) + (dma_addr + size - 1) > s390_domain->domain.geometry.aperture_end) return -EINVAL; nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; |