powerpc/iommu: Fix the overflow validation in iommu_tce_check_ioba
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b1af23d836f811137d504d14d4cbdd01929dec34 · < 0543813753ef5cfbd6fa96694f7acf783fa01af7| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
powerpc/iommu: Fix the overflow validation in iommu_tce_check_ioba
The commit b1af23d836f8 ("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'.
From the CVE record · Linux
The Linux kernel’s powerpc IOMMU check ignores the requested page count when validating an IOBA range. Multi-page H_STUFF_TCE or H_PUT_TCE_INDIRECT requests may therefore pass validation despite exceeding the table capacity. The input does not specify attacker access requirements, user interaction, or a further impact.
Engineers running Linux kernels with the affected powerpc IOMMU code should check their versions; no affected version range is provided.