🇰🇷 한글 설명
Linux 커널의 iommu/vt-d 구성 요소에서 SVA(Shared Virtual Addressing) 언바인드 시 대기 중인 IOPF(I/O Page Fault)로 인해 Use-After-Free(UAF) 취약점이 발생합니다. 이 결함은 잘못된 위치에서 IOPF를 비활성화하여 참조 횟수 언더플로우를 유발하고 커널 패닉을 일으킬 수 있습니다.
💡 쉬운 설명
컴퓨터의 하드웨어가 메모리를 사용하는 과정에서 이미 삭제된 메모리 주소를 다시 참조하려고 시도하여 시스템이 멈추는 문제입니다. 이로 인해 운영체제가 갑자기 꺼지거나 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
iommu/vt-d: Fix UAF on sva unbind with pending IOPFs
Commit 17fce9d2336d ("iommu/vt-d: Put iopf enablement in domain attach
path") disables IOPF on device by removing the device from its IOMMU's
IOPF queue when the last IOPF-capable domain is detached from the device.
Unfortunately, it did this in a wrong place where there are still pending
IOPFs. As a result, a use-after-free error is potentially triggered and
eventually a kernel panic with a kernel trace similar to the following:
refcount_t: underflow; use-after-free.
WARNING: CPU: 3 PID: 313 at lib/refcount.c:28 refcount_warn_saturate+0xd8/0xe0
Workqueue: iopf_queue/dmar0-iopfq iommu_sva_handle_iopf
Call Trace:
<TASK>
iopf_free_group+0xe/0x20
process_one_work+0x197/0x3d0
worker_thread+0x23a/0x350
? rescuer_thread+0x4a0/0x4a0
kthread+0xf8/0x230
? finish_task_switch.isra.0+0x81/0x260
? kthreads_online_cpu+0x110/0x110
? kthreads_online_cpu+0x110/0x110
ret_from_fork+0x13b/0x170
? kthreads_online_cpu+0x110/0x110
ret_from_fork_asm+0x11/0x20
</TASK>
---[ end trace 0000000000000000 ]---
The intel_pasid_tear_down_entry() function is responsible for blocking
hardware from generating new page faults and flushing all in-flight
ones. Therefore, moving iopf_for_domain_remove() after this function
should resolve this.
📍 영향받는 시스템
Intel VT-d를 사용하는 IOMMU 기능이 활성화된 Linux 커널 시스템
⚔️ 공격 벡터
특정 I/O 장치의 SVA 도메인을 해제하는 과정에서 의도적으로 대기 중인 페이지 폴트를 유발하여 커널 패닉 유도
🛡️ 대응 방법
커널 패치(Commit 17fce9d2336d 적용 버전)를 적용하여 iopf_for_domain_remove() 호출 위치를 수정해야 함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.