🇰🇷 한글 설명
Linux 커널의 dma-axi-dmac 드라이버에서 DMA 디스크립터 관리 시 DMA 풀을 사용하지 않아 발생하는 취약점입니다. Microblaze 또는 arm64 아키텍처에서 dma_free_coherent() 호출 시 softirq 컨텍스트에서 vunmap()이 실행되어 시스템 버그(BUG())를 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터 부품이 데이터를 주고받는 과정에서 메모리를 해제하는 방식이 잘못되어 시스템이 갑자기 멈추거나 오류가 발생할 수 있는 문제입니다. 이를 해결하기 위해 메모리를 미리 확보해두고 재사용하는 안전한 방식을 도입했습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
dmaengine: dma-axi-dmac: use DMA pool to manange DMA descriptor
For architectures like Microblaze or arm64 (where this IP is used),
DMA_DIRECT_REMAP is set which means that dma_alloc_coherent() might
remap (and hence vmalloc()) some memory. This became visible in a design
where dma_direct_use_pool() is not possible.
With the above, when calling dma_free_coherent(), vunmap() would be
called from softirq context and thus leading to a BUG().
To fix it, use a dma pool that is allocated in
.device_alloc_chan_resources() and allocate blocks from it. The key
point is that now dma_pool_free() is used in axi_dmac_free_desc() to
free the blocks and that just frees the blocks from the pool in the
sense they can be used again. In other words, no actual call to
dma_free_coherent() happens. That only happens when destroying the pool
in axi_dmac_free_chan_resources() which does not happen in any interrupt
context.
📍 영향받는 시스템
Linux kernel (Microblaze, arm64 아키텍처 기반의 dma-axi-dmac 드라이버 사용 시스템)
⚔️ 공격 벡터
직접적인 외부 공격보다는 특정 하드웨어 동작 조건에서 시스템 커널 패닉을 유발하는 로컬/환경적 요인
🛡️ 대응 방법
dma-axi-dmac 드라이버가 DMA pool을 사용하여 디스크립터를 관리하도록 커널을 업데이트해야 합니다.
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 패치가 적용된 최신 버전인지 확인합니다.