🇰🇷 한글 설명
Linux 커널의 dmaengine mmp_pdma 구성 요소에서 mmp_pdma_residue() 함수 호출 시 레이스 컨디션이 발생합니다. 이로 인해 여러 스레드가 동시에 상태를 확인할 때 이미 해제된 디스크립터를 참조하는 Use-After-Free(UAF) 취약점이 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터의 데이터 전송을 관리하는 과정에서 여러 작업이 동시에 같은 정보를 건드리면서, 이미 삭제된 정보를 다시 사용하려고 시도하는 오류입니다. 이로 인해 시스템이 갑자기 멈추거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
dmaengine: mmp_pdma: Fix race condition in mmp_pdma_residue()
Add proper locking in mmp_pdma_residue() to prevent use-after-free when
accessing descriptor list and descriptor contents.
The race occurs when multiple threads call tx_status() while the tasklet
on another CPU is freeing completed descriptors:
CPU 0 CPU 1
----- -----
mmp_pdma_tx_status()
mmp_pdma_residue()
-> NO LOCK held
list_for_each_entry(sw, ..)
DMA interrupt
dma_do_tasklet()
-> spin_lock(&desc_lock)
list_move(sw->node, ...)
spin_unlock(&desc_lock)
| dma_pool_free(sw) <- FREED!
-> access sw->desc <- UAF!
This issue can be reproduced when running dmatest on the same channel with
multiple threads (threads_per_chan > 1).
Fix by protecting the chain_running list iteration and descriptor access
with the chan->desc_lock spinlock.
📍 영향받는 시스템
Linux kernel (dmaengine: mmp_pdma 모듈 사용 시)
⚔️ 공격 벡터
멀티스레드 환경에서 dmatest 등을 통해 특정 DMA 채널에 동시 접근하여 레이스 컨디션 유도
🛡️ 대응 방법
커널 패치를 적용하여 mmp_pdma_residue() 함수 내에 chan->desc_lock 스핀락을 추가하여 동기화 처리
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 패치 버전인지 확인합니다.