🇰🇷 한글 설명
Linux 커널의 drm/virtio 구성 요소에서 Xen PV 도메인 사용 시 DMA API를 적절히 사용하지 않아 발생하는 취약점입니다. 이로 인해 호스트가 게스트의 물리 주소가 아닌 잘못된 메모리 주소를 참조하게 되어 다른 도메인의 메모리를 스캔할 수 있는 보안 문제가 발생합니다.
💡 쉬운 설명
가상화 환경에서 컴퓨터가 메모리 주소를 잘못 계산하여, 원래 보여주면 안 되는 다른 영역의 데이터를 읽어올 수 있는 문제입니다. 이는 개인정보나 중요한 데이터가 유출될 수 있는 위험을 초래합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
drm/virtio: use the DMA API for resource backing on Xen
On a Xen PV domain page addresses bear no relation to the real machine
addresses the host would have to use to reach it.
virtio_ring.c handles this correctly, vring_use_map_api() returns true
for any xen_domain() regardless of VIRTIO_F_ACCESS_PLATFORM.
virtio-gpu makes the same decision independently, but its copy
looks only at the feature bit:
bool use_dma_api = !virtio_has_dma_quirk(vgdev->vdev);
QEMU does not set iommu_platform on virtio-vga by default, so
VIRTIO_F_ACCESS_PLATFORM is not negotiated, use_dma_api is false, and
virtio_gpu_object_shmem_init() describes the framebuffer's backing pages
to the host with sg_phys(). Those are guest-physical addresses. In a PV
domain they resolve, on the host side, to pages belonging to some other
domain, so the host scans out unrelated memory.
Move the decision into virtio_gpu_use_dma_api() and give it the
xen_domain() check, like vring_use_map_api() has. This
additionally enables the dma_sync_sgtable_for_device() calls in
virtgpu_vq.c, which are required for correctness whenever swiotlb
is in play.
Reproduced with a Xen 4.21 PV dom0 nested inside QEMU 8.2 with
virtio-vga, on both a distro 6.8 kernel and 6.18 LTS. A PVH dom0
works fine and doesn't need this fix because it is identity-mapped,
only PV dom0s are affected.
📍 영향받는 시스템
Linux Kernel (6.8 및 6.18 LTS 포함) 및 Xen PV 도메인을 사용하는 QEMU 환경
⚔️ 공격 벡터
Xen PV 도메인 환경에서 virtio-vga를 사용하는 가상 머신을 통해 호스트의 잘못된 메모리 영역에 접근
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 virtio-gpu의 DMA API 사용 로직을 수정해야 합니다.
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 패치 버전인지 확인합니다.