🇰🇷 한글 설명
Linux 커널의 Intel VT-d Scalable Mode에서 PASID 엔트리를 삭제할 때, 'Present' 비트를 먼저 해제하지 않고 전체 데이터를 즉시 0으로 초기화하여 발생하는 취약점입니다. 이 과정에서 하드웨어가 불완전하게 업데이트된 데이터를 읽게 되어 예측 불가능한 동작이나 오류가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터 부품이 데이터를 읽고 있는 도중에 CPU가 데이터를 한꺼번에 지워버려서, 부품이 잘못된 정보를 읽게 되는 문제입니다. 이로 인해 시스템이 갑자기 멈추거나 예상치 못한 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
iommu/vt-d: Clear Present bit before tearing down PASID entry
The Intel VT-d Scalable Mode PASID table entry consists of 512 bits (64
bytes). When tearing down an entry, the current implementation zeros the
entire 64-byte structure immediately using multiple 64-bit writes.
Since the IOMMU hardware may fetch these 64 bytes using multiple
internal transactions (e.g., four 128-bit bursts), updating or zeroing
the entire entry while it is active (P=1) risks a "torn" read. If a
hardware fetch occurs simultaneously with the CPU zeroing the entry, the
hardware could observe an inconsistent state, leading to unpredictable
behavior or spurious faults.
Follow the "Guidance to Software for Invalidations" in the VT-d spec
(Section 6.5.3.3) by implementing the recommended ownership handshake:
1. Clear only the 'Present' (P) bit of the PASID entry.
2. Use a dma_wmb() to ensure the cleared bit is visible to hardware
before proceeding.
3. Execute the required invalidation sequence (PASID cache, IOTLB, and
Device-TLB flush) to ensure the hardware has released all cached
references.
4. Only after the flushes are complete, zero out the remaining fields
of the PASID entry.
Also, add a dma_wmb() in pasid_set_present() to ensure that all other
fields of the PASID entry are visible to the hardware before the Present
bit is set.
📍 영향받는 시스템
Intel VT-d Scalable Mode를 사용하는 Linux 커널 시스템
⚔️ 공격 벡터
하드웨어와 소프트웨어 간의 데이터 동기화 타이밍을 이용한 레이스 컨디션(Race Condition)
🛡️ 대응 방법
PASID 엔트리 삭제 시 'Present' 비트를 먼저 해제하고, 메모리 장벽(dma_wmb) 및 캐시 무효화 절차를 거친 후 나머지 데이터를 초기화하도록 커널 패치 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 최신 보안 패치 버전인지 확인