🇰🇷 한글 설명
Linux 커널의 drm/imagination 드라이버에서 GPU VM 메모리 매핑 시 vm_ctx->lock을 획득하지 않아 발생하는 취약점입니다. 이로 인해 find 작업과 map/unmap 작업이 동시에 진행될 경우 NULL 포인터 역참조가 발생하여 시스템이 충돌할 수 있습니다.
💡 쉬운 설명
컴퓨터의 그래픽 메모리를 관리하는 과정에서 두 가지 작업이 동시에 충돌하여 시스템이 멈추거나 오류가 발생하는 문제입니다. 메모리 주소를 찾는 도중에 주소를 바꾸려고 시도하면서 발생하는 충돌입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
drm/imagination: acquire vm_ctx->lock before mapping memory to GPU VM
The drm gpuvm code doesn't protect find operation against map operation,
and the driver needs to ensure a map operation shouldn't happen when a
find operation is in progress.
In some cases a find operation will be in progress when doing map/unmap
operations, and the find operation will do a NULL pointer dereference.
An example of the stack trace of such NULL dereference is shown below:
```
Unable to handle kernel access to user memory without uaccess routines at
virtual address 0000000000000010
[<ffffffff01e989d4>] drm_gpuva_find+0x28/0x6c [drm_gpuvm]
[<ffffffff01ed3a40>] pvr_vm_unmap+0x34/0x68 [powervr]
[<ffffffff01ec69da>] pvr_ioctl_vm_unmap+0x2e/0x50 [powervr]
[<ffffffff8080ce0a>] drm_ioctl_kernel+0x8e/0xdc
[<ffffffff8080d016>] drm_ioctl+0x1be/0x3e0
[<ffffffff802bec3e>] __riscv_sys_ioctl+0xba/0xc4
[<ffffffff80d858b2>] do_trap_ecall_u+0x23e/0x3f4
[<ffffffff80d92288>] handle_exception+0x168/0x174
```
As all occurences of drm_gpuva_find*() are already guarded by
vm_ctx->lock, make pvr_vm_map() to acquire this lock to prevent
disturbing any find operation. This fixes the NULL deference problem in
drm_gpuva_find*().
📍 영향받는 시스템
Linux kernel (drm/imagination 및 powervr 드라이버 사용 시스템)
⚔️ 공격 벡터
로컬 사용자가 특수하게 조작된 ioctl 시스템 호출을 통해 메모리 매핑/언매핑 작업을 동시에 수행하여 커널 패닉 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 drm_gpuvm의 잠금 메커니즘을 적용해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인합니다.