🇰🇷 한글 설명
Linux 커널의 Marvell SAS/SATA 컨트롤러 드라이버(mvsas)에서 mvs_work_queue 작업 처리 중 Use-After-Free 취약점이 발견되었습니다. 컨트롤러 분리 과정에서 지연된 작업이 완전히 종료되기 전에 메모리가 해제되어, 실행 중인 작업이 이미 해제된 메모리에 접근할 수 있는 레이스 컨디션이 발생합니다.
💡 쉬운 설명
장치를 제거할 때 컴퓨터가 하던 일을 다 끝내기도 전에 관련 메모리를 먼저 지워버려서 발생하는 문제입니다. 이로 인해 시스템이 갑자기 멈추거나 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
scsi: mvsas: Fix use-after-free bugs in mvs_work_queue
During the detaching of Marvell's SAS/SATA controller, the original code
calls cancel_delayed_work() in mvs_free() to cancel the delayed work
item mwq->work_q. However, if mwq->work_q is already running, the
cancel_delayed_work() may fail to cancel it. This can lead to
use-after-free scenarios where mvs_free() frees the mvs_info while
mvs_work_queue() is still executing and attempts to access the
already-freed mvs_info.
A typical race condition is illustrated below:
CPU 0 (remove) | CPU 1 (delayed work callback)
mvs_pci_remove() |
mvs_free() | mvs_work_queue()
cancel_delayed_work() |
kfree(mvi) |
| mvi-> // UAF
Replace cancel_delayed_work() with cancel_delayed_work_sync() to ensure
that the delayed work item is properly canceled and any executing
delayed work item completes before the mvs_info is deallocated.
This bug was found by static analysis.
📍 영향받는 시스템
Marvell SAS/SATA 컨트롤러를 사용하는 Linux 커널 시스템
⚔️ 공격 벡터
로컬 공격자가 장치 제거(remove) 프로세스를 유도하여 레이스 컨디션을 일으킴으로써 메모리 오류 유발
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 cancel_delayed_work_sync()가 적용된 드라이버를 사용해야 함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인