diff options
| author | 2026-09-25 18:11:39 +0200 | |
|---|---|---|
| committer | 2026-10-14 21:16:13 -0300 | |
| commit | f6b3fd8f573e801066c21b2aec3d2e949e61e48e (patch) | |
| tree | bf3a18e948b45a191373298c6fbf110f32a9705a /scripts/Makefile.thinlto | |
| parent | iommufd/iova_bitmap: Fail GET_DIRTY_BITMAP when a bitmap page cannot be pinned (diff) | |
iommufd: Reject a zero-length dirty bitmap request
iommufd_check_iova_range() subtracts one from bitmap->length before it
checks the length, so a zero-length request wraps to SIZE_MAX. With
iova = 0 the wrapped value passes the overflow and alignment checks, and
the request reaches iova_bitmap_alloc() with length 0.
iova_bitmap_alloc() then sizes the bitmap from a length - 1 of SIZE_MAX,
so mapped_total_index is effectively unbounded. The scan uses
last_iova = ULONG_MAX, which spans the whole IOAS when an area is mapped
at IOVA 0. Reject a zero length before the subtraction.
Fixes: b9a60d6f850e ("iommufd: Add IOMMU_HWPT_GET_DIRTY_BITMAP")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Andrea Parri <parri.andrea@gmail.com>
Link: https://patch.msgid.link/20260925161142.189813-4-parri.andrea@gmail.com
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
