Re: [PATCH v7 2/5] iommu: Use resource_size_t for reserved region length

From: Dmitry Baryshkov

Date: Wed Nov 11 2026 - 08:12:08 EST


On Fri, Nov 06, 2026 at 10:44:25PM +0530, Vikash Garodia wrote:
> On 32-bit systems with LPAE, physical addresses are 64-bit. A reserved
> region can be larger than 4GiB, but its length is stored as size_t,
> which is only 32-bit there. The length gets truncated.
> Use resource_size_t for the length so it matches the width of
> phys_addr_t and holds the full size of the region.
>
> Fixes: 2b20cbba3390 ("iommu: iommu_alloc_resv_region")
> Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
> Closes: https://lore.kernel.org/all/d223ee9f-b262-408a-a201-8b16d310bbe0@xxxxxxxxxxxxxxxx
> Cc: stable@xxxxxxxxxxxxxxx
> Co-developed-by: Vishnu Reddy <busanna.reddy@xxxxxxxxxxxxxxxx>
> Signed-off-by: Vishnu Reddy <busanna.reddy@xxxxxxxxxxxxxxxx>
> Signed-off-by: Vikash Garodia <vikash.garodia@xxxxxxxxxxxxxxxx>
> ---
> drivers/iommu/amd/iommu.c | 2 +-
> drivers/iommu/intel/iommu.c | 2 +-
> drivers/iommu/iommu.c | 2 +-
> drivers/iommu/of_iommu.c | 4 ++--
> drivers/iommu/virtio-iommu.c | 2 +-
> drivers/of/address.c | 2 +-
> drivers/vfio/vfio_iommu_type1.c | 2 +-
> include/linux/iommu.h | 4 ++--
> include/linux/of_address.h | 2 +-
> 9 files changed, 11 insertions(+), 11 deletions(-)
>

Thanks!


Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>



--
With best wishes
Dmitry