🇰🇷 한글 설명
Linux 커널 AMD GPU 드라이버에서 다중 GPU 간 메모리 버퍼 공유 시 동기화 버그로, 버퍼 이동 중 다른 GPU의 페이지 테이블 업데이트 타이밍이 맞지 않아 진행 중인 GPU 작업이 페이지 폴트를 발생시킬 수 있습니다. 이는 P2P PCI를 지원하지 않는 시스템에서 두 개 이상의 AMD GPU를 사용할 때 발생합니다.
💡 쉬운 설명
여러 개의 GPU가 메모리를 공유할 때, 한 GPU가 메모리 위치를 옮기면 다른 GPU도 이를 알아야 하는데, 타이밍이 맞지 않아 다른 GPU가 잘못된 위치의 메모리에 접근할 수 있습니다. 이로 인해 그래픽 작업이 중단되거나 시스템 불안정성이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
drm/amdgpu: fix sync handling in amdgpu_dma_buf_move_notify
Invalidating a dmabuf will impact other users of the shared BO.
In the scenario where process A moves the BO, it needs to inform
process B about the move and process B will need to update its
page table.
The commit fixes a synchronisation bug caused by the use of the
ticket: it made amdgpu_vm_handle_moved behave as if updating
the page table immediately was correct but in this case it's not.
An example is the following scenario, with 2 GPUs and glxgears
running on GPU0 and Xorg running on GPU1, on a system where P2P
PCI isn't supported:
glxgears:
export linear buffer from GPU0 and import using GPU1
submit frame rendering to GPU0
submit tiled->linear blit
Xorg:
copy of linear buffer
The sequence of jobs would be:
drm_sched_job_run # GPU0, frame rendering
drm_sched_job_queue # GPU0, blit
drm_sched_job_done # GPU0, frame rendering
drm_sched_job_run # GPU0, blit
move linear buffer for GPU1 access #
amdgpu_dma_buf_move_notify -> update pt # GPU0
It this point the blit job on GPU0 is still running and would
likely produce a page fault.
📍 영향받는 시스템
AMD Radeon GPU를 사용하는 Linux 시스템 (amdgpu 드라이버), 특히 다중 GPU 환경과 P2P PCI를 지원하지 않는 구성
⚔️ 공격 벡터
로컬 공격자가 다중 GPU 환경에서 특정 그래픽 애플리케이션을 실행하여 메모리 동기화 조건을 트리거하고 페이지 폴트 또는 DoS 유발
🛡️ 대응 방법
Linux 커널을 최신 버전으로 업데이트하여 amdgpu_dma_buf_move_notify 동기화 수정 패치 적용
🔧 검증 코드
lspci로 AMD GPU 존재 여부를 확인하고 uname으로 커널 버전을 확인합니다. AMD GPU가 있으면 취약한 시스템이므로 커널 패치가 필요합니다.
lspci 2>/dev/null | grep -i amd; uname -r