🇰🇷 한글 설명
Linux 커널의 DRM XE 드라이버에서 특정 설정(CONFIG_DRM_XE_USERPTR_INVAL_INJECT=y)이 활성화된 경우, notifier_lock을 읽기 모드로 보유한 상태에서 쓰기 모드가 필요한 함수를 호출하여 발생하는 경합 조건 및 어설션 오류 취약점입니다. 이로 인해 시스템의 안정성이 저해되거나 커널 패닉이 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터의 그래픽 처리 장치(GPU)를 관리하는 소프트웨어에서 데이터 접근 권한을 잘못 관리하여 충돌이 발생하는 문제입니다. 특정 테스트 기능이 켜져 있을 때 시스템이 예상치 못한 동작을 하거나 멈출 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
drm/xe/userptr: Hold notifier_lock for write on inject test path
When CONFIG_DRM_XE_USERPTR_INVAL_INJECT=y, xe_pt_svm_userptr_pre_commit()
runs vma_check_userptr() with the svm notifier_lock taken for read. The
test injection causes vma_check_userptr() to call
xe_vma_userptr_force_invalidate(), which feeds into
xe_vma_userptr_do_inval() with drm_gpusvm_ctx.in_notifier=true. That
flag tells drm_gpusvm_unmap_pages() the caller already holds
notifier_lock for write and only asserts the mode. Because the caller
actually holds it for read, the assertion fires:
WARNING: drivers/gpu/drm/drm_gpusvm.c:1669 at \
drm_gpusvm_unmap_pages+0xd4/0x130 [drm_gpusvm_helper]
Call Trace:
xe_vma_userptr_do_inval+0x40d/0xfd0 [xe]
xe_vma_userptr_invalidate_pass1+0x3e6/0x8d0 [xe]
xe_vma_userptr_force_invalidate+0xde/0x290 [xe]
vma_check_userptr.constprop.0+0x1c6/0x220 [xe]
xe_pt_svm_userptr_pre_commit+0x6a3/0xc60 [xe]
...
xe_vm_bind_ioctl+0x3a0a/0x4480 [xe]
Acquire notifier_lock for write in pre-commit when the inject Kconfig
is enabled, via new helpers xe_pt_svm_userptr_notifier_lock()/_unlock().
Rename xe_svm_assert_held_read() to
xe_svm_assert_held_read_or_inject_write() so it asserts the correct
mode under each build configuration. Production builds
(CONFIG_DRM_XE_USERPTR_INVAL_INJECT=n) keep the existing read-mode
behavior bit-for-bit.
(cherry picked from commit 80ccbd97ffee8ad2e73167d826fe7be548364365)
📍 영향받는 시스템
Linux Kernel (CONFIG_DRM_XE_USERPTR_INVAL_INJECT=y 설정이 활성화된 경우)
⚔️ 공격 벡터
특정 커널 설정이 활성화된 환경에서 GPU 관련 시스템 호출(ioctl)을 통한 트리거
🛡️ 대응 방법
커널 패치를 적용하거나 해당 테스트용 Kconfig 설정을 비활성화(n)하여 업데이트된 커널로 교체
🔧 검증 코드
결과값이 'CONFIG_DRM_XE_USERPTR_INVAL_INJECT=y'로 나오면 취약한 설정이 활성화된 상태입니다.
grep CONFIG_DRM_XE_USERPTR_INVAL_INJECT /boot/config-$(uname -r) 2>/dev/null