]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iommu/riscv: Remove overflows on the invalidation path
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 27 Mar 2026 15:22:10 +0000 (12:22 -0300)
committerJoerg Roedel <joerg.roedel@amd.com>
Thu, 2 Apr 2026 07:35:49 +0000 (09:35 +0200)
commit40a13b49957937427bc23e78eb50679df4396a47
treeb6289e34e439971b87685fe606e5ba9b96c20517
parent553a127cb66523089bc10eb54640205495f4bb5b
iommu/riscv: Remove overflows on the invalidation path

Since RISC-V supports a sign extended page table it should support
a gather->end of ULONG_MAX, but if this happens it will infinite loop
because of the overflow.

Also avoid overflow computing the length by moving the +1 to the other
side of the <

Fixes: 488ffbf18171 ("iommu/riscv: Paging domain support")
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/riscv/iommu.c