🇰🇷 한글 설명
리눅스 커널의 dmam_free_coherent 함수에서 DMA 할당 해제와 데이터 구조체 삭제 순서가 잘못되어 발생하는 취약점입니다. 할당 해제와 삭제 사이의 간극을 이용해 동일한 가상 주소를 가진 새로운 할당이 발생할 경우, devres 리스트에 중복 항목이 생성되어 잘못된 항목이 삭제될 수 있습니다.
💡 쉬운 설명
메모리를 정리하는 과정에서 순서가 뒤바뀌어, 시스템이 엉뚱한 메모리 정보를 지우려고 시도할 수 있는 문제입니다. 이로 인해 시스템 오류나 경고가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
dma: fix call order in dmam_free_coherent
dmam_free_coherent() frees a DMA allocation, which makes the
freed vaddr available for reuse, then calls devres_destroy()
to remove and free the data structure used to track the DMA
allocation. Between the two calls, it is possible for a
concurrent task to make an allocation with the same vaddr
and add it to the devres list.
If this happens, there will be two entries in the devres list
with the same vaddr and devres_destroy() can free the wrong
entry, triggering the WARN_ON() in dmam_match.
Fix by destroying the devres entry before freeing the DMA
allocation.
kokonut //net/encryption
http://sponge2/b9145fe6-0f72-4325-ac2f-a84d81075b03
📍 영향받는 시스템
DMA를 사용하는 리눅스 커널 (특정 버전 명시되지 않음)
⚔️ 공격 벡터
동시성(Concurrency)을 이용한 레이스 컨디션 공격을 통해 특정 가상 주소에 대한 메모리 할당을 유도함
🛡️ 대응 방법
DMA 할당을 해제하기 전에 devres 항목을 먼저 파괴하도록 커널 패치를 적용함
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 최신 패치 버전인지 확인합니다.