🇰🇷 한글 설명
Linux 커널의 Intel VT-d IOMMU 드라이버에서, 기존 패치가 연결 해제된 장치만 확인하던 문제를 수정했습니다. 이제 링크 다운(장애로 인한 연결 끊김) 상태에서도 장치 접근 가능 여부를 확인해 ATS 무효화 요청을 건너뛰어 하드 락업을 방지합니다.
💡 쉬운 설명
가상머신이 PCIe 장치에 연결되지 못하고 장애가 발생하면, 자원 해제 과정에서 시스템이 완전히 멈출 수 있었습니다. 이번 수정은 장치가 실제로 접근 가능한지 먼저 확인하여 이 멈춤을 막습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
iommu/vt-d: Flush dev-IOTLB only when PCIe device is accessible in scalable mode
Commit 4fc82cd907ac ("iommu/vt-d: Don't issue ATS Invalidation
request when device is disconnected") relies on
pci_dev_is_disconnected() to skip ATS invalidation for
safely-removed devices, but it does not cover link-down caused
by faults, which can still hard-lock the system.
For example, if a VM fails to connect to the PCIe device,
"virsh destroy" is executed to release resources and isolate
the fault, but a hard-lockup occurs while releasing the group fd.
Call Trace:
qi_submit_sync
qi_flush_dev_iotlb
intel_pasid_tear_down_entry
device_block_translation
blocking_domain_attach_dev
__iommu_attach_device
__iommu_device_set_domain
__iommu_group_set_domain_internal
iommu_detach_group
vfio_iommu_type1_detach_group
vfio_group_detach_container
vfio_group_fops_release
__fput
Although pci_device_is_present() is slower than
pci_dev_is_disconnected(), it still takes only ~70 µs on a
ConnectX-5 (8 GT/s, x2) and becomes even faster as PCIe speed
and width increase.
Besides, devtlb_invalidation_with_pasid() is called only in the
paths below, which are far less frequent than memory map/unmap.
1. mm-struct release
2. {attach,release}_dev
3. set/remove PASID
4. dirty-tracking setup
The gain in system stability far outweighs the negligible cost
of using pci_device_is_present() instead of pci_dev_is_disconnected()
to decide when to skip ATS invalidation, especially under GDR
high-load conditions.
📍 영향받는 시스템
Intel VT-d 기반 IOMMU를 사용하고 scalable mode로 동작하는 수정 이전의 Linux 커널 (패치 4fc82cd907ac 이후 버전 포함)
⚔️ 공격 벡터
로컬 사용자 또는 가상머신 환경에서 PCIe 장치 장애를 유발한 뒤 자원 해제를 수행하여 시스템 하드 락업(서비스 거부)을 일으킬 수 있음
🛡️ 대응 방법
패치가 적용된 최신 Linux 커널로 업데이트하고 재부팅하거나, 배포판 공급사의 보안 업데이트를 설치하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 수정이 포함된 배포판 업데이트 버전 이상인지 확인하고, 부트 파라미터에 intel_iommu가 있고 DMAR 로그가 보이면 Intel VT-d IOMMU가 활성화된 환경이므로 패치 적용 대상입니다.
uname -r && grep -i 'vt-d\|intel_iommu' /proc/cmdline 2>/dev/null; dmesg 2>/dev/null | grep -i 'DMAR' | head -5