iommu/amd: Fix potential out-of-bounds read in iommu_mmio_show
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.17.136.18.26.19In the Linux kernel, the following vulnerability has been resolved:
iommu/amd: Fix potential out-of-bounds read in iommu_mmio_show
In iommu_mmio_write(), it validates the user-provided offset with the check: `iommu->dbg_mmio_offset > iommu->mmio_phys_end - 4`. This assumes a 4-byte access. However, the corresponding show handler, iommu_mmio_show(), uses readq() to perform an 8-byte (64-bit) read.
If a user provides an offset equal to `mmio_phys_end - 4`, the check passes, and will lead to a 4-byte out-of-bounds read.
Fix this by adjusting the boundary check to use sizeof(u64), which corresponds to the size of the readq() operation.
From the CVE record · Linux
The Linux kernel’s AMD IOMMU MMIO show handler performs an 8-byte read after a boundary check that assumes a 4-byte access. A local user able to provide an offset of `mmio_phys_end - 4` can trigger a 4-byte out-of-bounds read; authentication requirements are not specified.
Teams running Linux kernels with the affected AMD IOMMU MMIO handler should check their kernel version against the vendor advisory; affected versions were not provided.