🇰🇷 한글 설명
Linux 커널의 Intel Xe DRM 드라이버에서 ttm.resource가 없는(메모리 배치가 해제된) BO에 대해 eviction을 시도할 때 NULL 포인터 역참조가 발생하는 문제입니다. 해당 BO는 배치된 메모리가 없으므로 빈 placement를 반환하도록 수정되었습니다.
💡 쉬운 설명
그래픽 메모리 관리 과정에서 이미 비어 있는 자원을 정리하려다 시스템이 충돌할 수 있는 버그입니다. 수정으로 빈 자원은 정리 작업을 건너뛰도록 처리되어 충돌이 방지됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
drm/xe: skip eviction of a BO with no resource
xe_evict_flags() switches on tbo->resource->mem_type to choose an
eviction placement. An xe BO can reach eviction with no ttm.resource,
e.g. an imported dma-buf BO whose resource was freed during teardown
while its attachment is still live: the exporter then invalidates it via
xe_dma_buf_move_notify() -> xe_bo_evict(), and the switch dereferences a
NULL resource and faults.
A BO with no resource has nothing placed or mapped, so there is nothing
to evict. Return an empty placement (num_placement = 0), mirroring the
handling already used for non-xe scatter-gather BOs just above;
ttm_bo_validate() then takes the pipeline-gutting path and returns 0.
Without the fix the xe_dma_buf@xe_test_dmabuf_move_notify_no_resource
dynamic live selftest will fail with below stack.
BUG: kernel NULL pointer dereference, address: 0000000000000010
RIP: 0010:xe_evict_flags+0xf4/0x140 [xe]
Call Trace:
<TASK>
xe_bo_evict+0x40/0xa0 [xe]
? ttm_bo_pipeline_gutting+0x71/0x180 [ttm]
xe_test_dmabuf_move_notify_no_resource+0x182/0x440 [xe]
xe_dma_buf_kunit+0x387/0x580 [xe]
v2: Add Fixes tag and failure info in commit text (Matt Brost)
(cherry picked from commit dbcfaac6331f1fcb0c2fe3ad3e9adb1e5d43ec0c)
📍 영향받는 시스템
Intel Xe 그래픽 드라이버(drm/xe)를 사용하는 수정 전 Linux 커널 버전
⚔️ 공격 벡터
로컬 사용자가 dma-buf 공유 과정을 조작해 eviction 경로를 유발하면 커널 패닉(서비스 거부)이 발생할 수 있음
🛡️ 대응 방법
패치가 포함된 최신 Linux 커널 버전으로 업데이트하거나 배포판 보안 업데이트를 적용
🔧 검증 코드
출력된 커널 버전을 배포판의 패치 목록/변경 로그와 대조해 해당 커밋(dbcfaac6331f)이 반영되었는지 확인하며, 반영되지 않은 버전이면 업데이트가 필요합니다