🇰🇷 한글 설명
Linux 커널의 iommu/vt-d 구성 요소에서 RID 도메인 교체 시 iopf 참조 횟수(refcount)가 누수되는 취약점이 발견되었습니다. 이로 인해 참조 횟수가 0으로 돌아가지 않아 장치 해제 시 경고가 발생하거나 리소스가 제대로 정리되지 않을 수 있습니다.
💡 쉬운 설명
컴퓨터의 하드웨어 장치를 관리하는 과정에서 사용 기록을 남기는 숫자가 제대로 지워지지 않고 계속 쌓이는 문제입니다. 이 문제가 지속되면 시스템 리소스가 낭비되거나 장치를 끌 때 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
iommu/vt-d: Fix iopf_refcount leak on RID domain replacement
intel_iommu_attach_device() enables IOPF for the new domain but never
disables it for the old one. device_block_translation(), called at the
start of the function, tears down translation but does not touch any IOPF
state; blocking_domain_attach_dev() has to call iopf_for_domain_remove()
explicitly before invoking it for exactly this reason.
identity_domain_attach_dev() has the same problem. Its comment claims
that no PRI handling is needed because the device has been put in the
blocking state, but the blocking state and the IOPF reference count are
independent of each other.
As a result, replacing a domain that has an iopf_handler with another
domain at RID level leaks a reference in info->iopf_refcount. The count
never drops back to zero, so iopf_queue_remove_device() is never called
and iommu_disable_pci_pri() triggers its WARN_ON(info->iopf_refcount)
when the device is released.
The PASID paths already handle this correctly by way of
iopf_for_domain_replace(); convert the two RID paths to do the same.
Using the replace helper rather than a bare remove keeps the enable
before the disable, so the reference count does not transiently reach
zero and evict the device from the IOPF queue.
📍 영향받는 시스템
IOMMU/VT-d를 사용하는 Linux 커널 시스템
⚔️ 공격 벡터
직접적인 공격보다는 시스템 운영 중 도메인 교체 과정에서 발생하는 리소스 누수 형태임
🛡️ 대응 방법
해당 취약점이 수정된 최신 버전의 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 취약점이 패치된 최신 릴리스 버전인지 확인