В ядре Linux устранена следующая уязвимость:
iommu/vt-d: очистить бит присутствия перед удалением записи контекста масштабируемого режима.
device_pasid_table_teardown() обнуляет 128-битный контекст масштабируемого режима
запись с помощью context_clear_entry(), пока бит Present все еще установлен. Это
создает окно, в котором оборудование может получить разорванную запись с некоторыми
поля уже обнулены, в то время как Present все еще установлено, что приводит к непредсказуемым
поведения или ложных ошибок. Аннулирование контекстного кэша выдается только
после того, как запись была обнулена, и intel_pasid_free_table() затем освобождает
страницы каталога PASID, чтобы IOMMU мог продолжать работать с устаревшим Present=1
запись, указывающая на освобожденную память.
Хотя x86 обеспечивает строгий порядок записи, компилятор может переупорядочить два
64-битная запись записывает в запись, и аппаратная выборка не гарантируется.
атомарный по отношению к нескольким операциям записи ЦП. Commit c1e4f1dccbe9d («iommu/vt-d: очистить бит Present перед удалением
запись контекста") исправил именно этот шаблон в domain_context_clear_one() и
путь скопированного контекста, но device_pasid_table_teardown() не был
преобразован. Согласуйте его с «Руководством по программному обеспечению для аннулирования» в VT-d.
спецификация, раздел 6.5.3.3, с использованием того же подтверждения владения, что и у родственного брата
исправление: очистить только бит Present, сбросить его в IOMMU, выполнить
аннулирование контекстного кэша и только затем обнуление остальной части записи.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: iommu/vt-d: Clear Present bit before tearing down scalable-mode context entry device_pasid_table_teardown() zeroes the 128-bit scalable-mode context entry with context_clear_entry() while the Present bit is still set. This creates a window where the hardware can fetch a torn entry, with some fields already zeroed while Present is still set, leading to unpredictable behavior or spurious faults. The context-cache invalidation is issued only after the entry has been zeroed, and intel_pasid_free_table() then frees the PASID directory pages, so the IOMMU can keep walking a stale Present=1 entry that points at freed memory. While x86 provides strong write ordering, the compiler may reorder the two 64-bit writes to the entry, and the hardware fetch is not guaranteed to be atomic with respect to multiple CPU writes. Commit c1e4f1dccbe9d ("iommu/vt-d: Clear Present bit before tearing down context entry") fixed this exact pattern in domain_context_clear_one() and the copied-context path, but device_pasid_table_teardown() was not converted. Align it with the "Guidance to Software for Invalidations" in the VT-d spec, Section 6.5.3.3, using the same ownership handshake as the sibling fix: clear only the Present bit, flush it to the IOMMU, perform the context-cache invalidation, and only then zero the rest of the entry.
Характеристики атаки
Последствия
Строка CVSS v3.1