🇰🇷 한글 설명
Linux 커널의 iommu/vt-d 구성 요소에서 scalable-mode 컨텍스트 엔트리를 해제할 때 Present 비트를 먼저 지우지 않아 발생하는 취약점입니다. 이로 인해 하드웨어가 유효하지 않은 메모리 주소를 참조하거나, 이미 해제된 메모리 영역을 참조하여 예측 불가능한 동작이나 오류를 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터의 메모리 관리 장치가 데이터를 지우는 과정에서 순서가 잘못되어, 장치가 이미 사라진 메모리 주소를 계속 읽으려고 시도하는 문제입니다. 이로 인해 시스템이 갑자기 멈추거나 예상치 못한 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
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.
📍 영향받는 시스템
Linux kernel (iommu/vt-d 구성 요소가 포함된 버전)
⚔️ 공격 벡터
로컬 공격자가 IOMMU 컨텍스트 해제 과정을 악용하여 메모리 오류를 유발하거나 시스템 불안정성을 초래할 수 있음
🛡️ 대응 방법
커널 패치(Commit c1e4f1dccbe9d 관련 수정 사항)를 적용하여 컨텍스트 해제 시 Present 비트를 먼저 명시적으로 제거하도록 업데이트해야 함
🔧 검증 코드
현재 커널 버전과 해당 취약점이 수정된 커밋 메시지가 로그에 포함되어 있는지 확인합니다.
uname -r && git log --grep="iommu/vt-d: Clear Present bit before tearing down scalable-mode context entry"