🇰🇷 한글 설명
Linux 커널의 DRM XE 드라이버에서 메모리 회수(shrinking) 과정 중 런타임 전원 관리(PM) 참조를 적절히 취하지 않아 발생하는 취약점입니다. GPU가 절전 모드(runtime suspended) 상태일 때 비시스템 메모리를 회수하려고 시도하면 페이지 테이블 무효화 과정에서 시스템 어설션(assert)이 발생하거나 -ENODEV 오류가 반환될 수 있습니다.
💡 쉬운 설명
컴퓨터가 절전 모드에 있을 때 그래픽 카드의 메모리를 정리하려고 하면 시스템이 충돌하거나 오류가 발생하는 문제입니다. 메모리를 정리하기 전에 그래픽 카드를 깨우는 과정이 누락되어 발생합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
drm/xe/shrinker: Take a runtime PM ref before shrinking non-system memory
__xe_shrinker_walk() walks the SYSTEM and TT LRUs without a runtime PM
reference. Shrinking a bo outside system memory invalidates its GPU
mappings, which needs the device resumed, so while it is runtime
suspended the page table zap trips an assert and the TLB invalidation
returns -ENODEV:
WARNING: drivers/gpu/drm/xe/xe_bo.c:770 at xe_bo_move_notify+0x1fc/0x450 [xe]
xe_bo_shrink+0x20f/0x2b0 [xe]
__xe_shrinker_walk+0x174/0x410 [xe]
xe_shrinker_scan+0x10c/0x1e0 [xe]
do_shrink_slab+0x176/0x7e0
drop_caches_sysctl_handler+0x9c/0xf0
Take a reference before walking a memory type other than XE_PL_SYSTEM
and stop there if it cannot be acquired. Reuse the shrinker's existing
acquire path, which resumes the device directly where reclaim allows
that and otherwise queues the PM worker for a later scan. Stop the walk
once the scan target is met, so a satisfied scan does not wake the
device. System memory is still reclaimed while the device is suspended.
Gate this on xe_device_is_l2_flush_optimized(), the same condition under
which xe_bo_trigger_rebind() issues the invalidation for a non-fault-mode
vm, so reclaim is unaffected elsewhere. The System CCS copy already has
its own reference in xe_bo_shrink().
Only a non-fault-mode vm can reach this, since a fault-mode vm requires
LR mode and that holds a runtime PM reference for the vm's lifetime.
Reproduced with igt@xe_madvise@dontneed-before-exec while the GPU is
runtime suspended.
v2: simplify needs_rpm check. (Matt)
retarget Fixes tag since the issue occurs with the non-fault-mode
path added by 4e7ebff69aed.
v3: handle this in xe_shrinker.c instead of xe_bo.c (Thomas)
v4: stop the walk once the scan target is met. (Sashiko)
v5: rebase on the freed page accounting fix. (Sashiko)
v6: reuse the shrinker acquire path so runtime pm can be resumed
directly instead of always queueing a worker. (Thomas)
v7: replace xe_pm_runtime_put() with xe_shrinker_runtime_pm_put(). (Thomas)
(cherry picked from commit 628f92b28bf4c371c10207daf6fc4caee0c0db2e)
📍 영향받는 시스템
Linux kernel (DRM XE driver 포함 버전)
⚔️ 공격 벡터
로컬 사용자가 특정 메모리 관리 작업(예: drop_caches)을 통해 GPU가 절전 모드인 상태에서 메모리 회수를 유도하여 시스템 오류 유발
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 수정된 패치 버전(commit 628f92b28bf4) 이후인지 확인합니다.
💻 영향받는 소프트웨어
NVIDIA Cloud Gaming Guest Driver for Linux