В ядре Linux была устранена следующая уязвимость: iommu/amd: Fix potential out-of-bounds read in iommu_mmio_show In iommu_mmio_write(), она проверяет предоставленное пользователем смещение с помощью проверки: iommu->dbg_mmio_offset > iommu->mmio_phys_end - 4. Это предполагает 4-байтный доступ. Однако соответствующий обработчик шоу, iommu_mmio_show(), использует readq() для выполнения 8-байтного (64-битного) чтения.
Если пользователь предоставляет смещение, равное mmio_phys_end - 4, проверка проходит, и приведет к 4-байтному чтению out-of-bounds. Исправьте это, настроив проверку границы для использования sizeof(u64), который соответствует размеру операции readq().
Показать оригинальное описание (EN)
In 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.