summaryrefslogtreecommitdiff
path: root/tools/perf/lib/include/internal/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorChaitanya Kulkarni <ckulkarnilinux@gmail.com>2025-12-19 15:28:58 -0800
committerJoerg Roedel <joerg.roedel@amd.com>2026-01-20 18:07:35 +0100
commit374e7af67d9d9d6103c2cfc8eb32abfecf3a2fd8 (patch)
treea01fb394787d01348490c4fd272a1b76c097e0a3 /tools/perf/lib/include/internal/git@git.tavy.me:linux.git
parent98d5110f90ae0dbc5f2f13f033e06f6d57009e0d (diff)
iommu/io-pgtable-arm: fix size_t signedness bug in unmap path
__arm_lpae_unmap() returns size_t but was returning -ENOENT (negative error code) when encountering an unmapped PTE. Since size_t is unsigned, -ENOENT (typically -2) becomes a huge positive value (0xFFFFFFFFFFFFFFFE on 64-bit systems). This corrupted value propagates through the call chain: __arm_lpae_unmap() returns -ENOENT as size_t -> arm_lpae_unmap_pages() returns it -> __iommu_unmap() adds it to iova address -> iommu_pgsize() triggers BUG_ON due to corrupted iova This can cause IOVA address overflow in __iommu_unmap() loop and trigger BUG_ON in iommu_pgsize() from invalid address alignment. Fix by returning 0 instead of -ENOENT. The WARN_ON already signals the error condition, and returning 0 (meaning "nothing unmapped") is the correct semantic for size_t return type. This matches the behavior of other io-pgtable implementations (io-pgtable-arm-v7s, io-pgtable-dart) which return 0 on error conditions. Fixes: 3318f7b5cefb ("iommu/io-pgtable-arm: Add quirk to quiet WARN_ON()") Cc: stable@vger.kernel.org Signed-off-by: Chaitanya Kulkarni <ckulkarnilinux@gmail.com> Acked-by: Will Deacon <will@kernel.org> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Rob Clark <robin.clark@oss.qualcomm.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'tools/perf/lib/include/internal/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions