summaryrefslogtreecommitdiff
path: root/scripts/basic/split-include.c
diff options
context:
space:
mode:
authorAndrea Parri <parri.andrea@gmail.com>2026-09-25 18:11:39 +0200
committerJason Gunthorpe <jgg@nvidia.com>2026-10-14 21:16:13 -0300
commitf6b3fd8f573e801066c21b2aec3d2e949e61e48e (patch)
treebf3a18e948b45a191373298c6fbf110f32a9705a /scripts/basic/split-include.c
parenta6ec38d74c08ddbe1b7c3936d6d25f346d12c7be (diff)
downloadlinux-next-f6b3fd8f573e801066c21b2aec3d2e949e61e48e.tar.gz
linux-next-f6b3fd8f573e801066c21b2aec3d2e949e61e48e.zip
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/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions