🇰🇷 한글 설명
Linux 커널의 drm/xe 드라이버에서 선점 펜스(preempt fence) 처리 중 Use-After-Free(UAF) 취약점이 발견되었습니다. 펜스 신호 후 큐의 참조를 해제하는 과정에서, 대기 중인 프로세스가 깨어나 락을 획득하려 할 때 이미 해제된 메모리에 접근할 수 있는 문제입니다.
💡 쉬운 설명
컴퓨터가 작업을 마쳤다는 신호를 보내고 관련 메모리를 지워버렸는데, 뒤늦게 깨어난 작업이 이미 사라진 메모리 주소를 붙잡으려다 발생하는 오류입니다. 이로 인해 시스템이 충돌하거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
drm/xe: prevent UAF around preempt fence
The fence lock is part of the queue, therefore in the current design
anything locking the fence should then also hold a ref to the queue to
prevent the queue from being freed.
However, currently it looks like we signal the fence and then drop the
queue ref, but if something is waiting on the fence, the waiter is
kicked to wake up at some later point, where upon waking up it first
grabs the lock before checking the fence state. But if we have already
dropped the queue ref, then the lock might already be freed as part of
the queue, leading to uaf.
To prevent this, move the fence lock into the fence itself so we don't
run into lifetime issues. Alternative might be to have device level
lock, or only release the queue in the fence release callback, however
that might require pushing to another worker to avoid locking issues.
References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2454
References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2342
References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2020
(cherry picked from commit 7116c35aacedc38be6d15bd21b2fc936eed0008b)
📍 영향받는 시스템
Linux Kernel (drm/xe 드라이버를 사용하는 시스템)
⚔️ 공격 벡터
로컬 공격자가 특정 그래픽 작업(drm/xe 관련)을 유도하여 메모리 해제 후 접근을 유발
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하거나 해당 커밋(7116c35a)이 포함된 버전으로 업그레이드
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 패치 버전 이후인지 확인