🇰🇷 한글 설명
Linux 커널 Intel Xe DRM 드라이버의 VM 종료 경로에서, 외부 버퍼 객체에 연결된 VMA를 해제하기 전에 페이지 테이블(pt_root)을 먼저 파괴하는 경쟁 조건이 존재합니다. 이로 인해 동시에 BO가 eviction될 때 pt_root가 NULL인 상태에서 참조되어 NULL 포인터 역참조가 발생할 수 있습니다. 패치는 연관된 VMA를 모두 unlink·destroy한 뒤에 scratch 및 페이지 테이블을 해제하도록 순서를 변경합니다.
💡 쉬운 설명
GPU 메모리 관리 과정에서 두 작업이 동시에 일어나면 아직 사용 중인 페이지 테이블이 먼저 삭제되어 시스템이 잘못된 메모리를 참조하게 됩니다. 이 패치는 삭제 순서를 바로잡아 이런 충돌을 막습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
drm/xe/vm: nuke PTs only after unlinking contested VMAs
In xe_vm_close_and_put(), external-BO VMAs are queued on the contested
list for deferred destruction via xe_vma_destroy_unlocked(). However,
xe_vm_pt_destroy() was previously invoked before processing contested
VMAs, destroying vm->pt_root while those VMAs were still linked to their
respective buffer objects (vm_bo->list.gpuva).
If a concurrent thread evicts one of those shared buffer objects,
xe_bo_trigger_rebind() holding only bo->resv walks the BO's VMAs and, in
fault mode, calls xe_vm_invalidate_vma() -> xe_pt_zap_ptes(). Because
vm->pt_root[tile->id] is already NULL, dereferencing pt->level causes a
NULL ptr deref.
Fix this by deferring xe_vm_free_scratch() and xe_vm_pt_destroy() until
after all contested VMAs have been unlinked and destroyed.
User is reporting hitting a NULL ptr deref in xe_pt_zap_ptes(), which
could be explained by this race.
(cherry picked from commit c2863648959489767f08892fd6e90577d2ea0b6a)
📍 영향받는 시스템
Intel Xe DRM 드라이버를 사용하는 Linux 커널 (수정 커밋 이전 버전, 정확한 버전은 배포판 패치 정보 확인 필요)
⚔️ 공격 벡터
로컬 사용자가 GPU 자원을 생성·해제하는 작업을 반복하며 동시에 공유 버퍼 eviction을 유발해 경쟁 조건을 일으키면 커널 NULL 포인터 역참조로 서비스 거부(크래시)가 발생할 수 있습니다.
🛡️ 대응 방법
배포판 또는 커널 공급사가 제공하는 해당 커밋(c2863648959489767f08892fd6e90577d2ea0b6a)이 포함된 최신 커널로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 패치가 반영된 배포판 업데이트 버전 이상인지 확인하고, lsmod 결과에 xe 모듈이 표시되면 해당 드라이버가 로드된 상태이므로 커널 업데이트 적용이 필요한지 판단하십시오.
uname -r && (grep -l xe /sys/module/*/parameters/* 2>/dev/null; lsmod | grep -w xe)