🇰🇷 한글 설명
Linux 커널의 vfio/cdx 구성 요소에서 발생하는 취약점으로, VFIO_DEVICE_SET_IRQS ioctl 호출 시 적절한 직렬화가 이루어지지 않아 발생합니다. 두 개 이상의 호출자가 동시에 실행될 경우, 한쪽에서 MSI를 비활성화하고 메모리를 해제하는 동안 다른 쪽에서 해당 메모리에 접근하여 Use-After-Free(UAF) 오류가 발생할 수 있습니다.
💡 쉬운 설명
장치를 제어하는 명령을 동시에 여러 번 내릴 때, 시스템이 이미 삭제된 메모리 영역을 다시 사용하려고 시도하여 오류가 발생하는 문제입니다. 이로 인해 시스템이 충돌하거나 보안 공격에 노출될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
vfio/cdx: Serialize VFIO_DEVICE_SET_IRQS with a per-device mutex
vfio_cdx_set_msi_trigger() reads vdev->config_msi and operates on the
vdev->cdx_irqs array based on its value, but provides no serialization
against concurrent VFIO_DEVICE_SET_IRQS ioctls. Two callers can race
such that one observes config_msi as set while another clears it and
frees cdx_irqs via vfio_cdx_msi_disable(), resulting in a use-after-free
of the cdx_irqs array.
Add a cdx_irqs_lock mutex to struct vfio_cdx_device and acquire it in
vfio_cdx_set_msi_trigger(), which is the single chokepoint through
which all updates to config_msi, cdx_irqs, and msi_count flow, covering
both the ioctl path and the close-device cleanup path. This keeps the
test of config_msi atomic with the subsequent enable, disable, or
trigger operations.
Drop the pre-call !cdx_irqs test from vfio_cdx_irqs_cleanup() as part
of this change: the optimization it provided is redundant with the
!config_msi early-return inside vfio_cdx_msi_disable(), and leaving the
test in place would be an unsynchronized read of state the new lock is
meant to protect.
📍 영향받는 시스템
Linux kernel (vfio/cdx 구성 요소가 포함된 버전)
⚔️ 공격 벡터
동시에 여러 개의 VFIO_DEVICE_SET_IRQS ioctl 호출을 수행하는 레이스 컨디션(Race Condition) 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 cdx_irqs_lock 뮤텍스가 적용된 패치를 적용해야 합니다.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전 이상인지 확인합니다.