Files
Shivaprasad G Bhat 0b271f7d7f powerpc/iommu: Fix the overflow validation in iommu_tce_check_ioba
The commit b1af23d836 ("KVM: PPC: iommu: Unify TCE checking") unified
IOBA parameter checking across KVM and VFIO into iommu_tce_check_ioba().
While doing so, the passed in argument npages is ignored and constant
value '1' is used leaving out a possible overflow as the callers can
legitimately be using npages > 1 for H_STUFF_TCE or H_PUT_TCE_INDIRECT
cases.

Fix this by accounting for 'npages', checking for arithmetic overflow,
and verifying that the entire requested range (ioba - offset + npages)
does not exceed the table capacity 'size'.

Fixes: b1af23d836 ("KVM: PPC: iommu: Unify TCE checking")
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Tested-by: R Nageswara Sastry <rnsastry@linux.ibm.com>
Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Signed-off-by: Gautam Menghani <gautam@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
2026-09-16 13:43:58 +05:30
..
2026-08-06 11:00:55 +05:30
2025-07-26 13:07:52 +05:30
2024-06-28 22:28:47 +10:00
2022-09-26 23:00:14 +10:00
2026-04-01 09:21:06 +05:30
2024-10-29 23:01:52 +11:00
2023-10-10 13:35:55 -06:00
2026-08-06 11:00:55 +05:30
2022-09-26 22:47:37 +10:00
2026-05-20 06:57:13 +05:30
2024-10-29 23:01:52 +11:00
2025-02-26 21:15:09 +05:30