🇰🇷 한글 설명
Linux 커널의 amlogic SPI 플래시 컨트롤러 드라이버에서 DMA 메모리 매핑 오류 처리의 세 가지 버그가 존재합니다. 첫 번째 매핑 실패 시 불필요한 goto 사용, 정보 매핑 실패 시 동일 메모리 영역의 이중 해제, 그리고 해제 시 잘못된 크기 값 사용이 메모리 오염과 커널 패닉을 야기할 수 있습니다.
💡 쉬운 설명
리눅스 커널의 SPI 저장장치 드라이버에서 메모리 해제 로직에 버그가 있어 같은 메모리를 여러 번 해제하거나 잘못된 크기로 해제하는 문제입니다. 로컬 사용자가 이를 악용하면 시스템을 불안정하게 만들거나 권한을 상승시킬 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
spi: amlogic: spifc-a4: Fix DMA mapping error handling
Fix three bugs in aml_sfc_dma_buffer_setup() error paths:
1. Unnecessary goto: When the first DMA mapping (sfc->daddr) fails,
nothing needs cleanup. Use direct return instead of goto.
2. Double-unmap bug: When info DMA mapping failed, the code would
unmap sfc->daddr inline, then fall through to out_map_data which
would unmap it again, causing a double-unmap.
3. Wrong unmap size: The out_map_info label used datalen instead of
infolen when unmapping sfc->iaddr, which could lead to incorrect
DMA sync behavior.
📍 영향받는 시스템
Linux kernel amlogic spifc-a4 드라이버 (특정 버전 이전의 커널)
⚔️ 공격 벡터
로컬 시스템 접근 권한이 있는 사용자가 SPI 플래시 컨트롤러의 DMA 작업을 트리거하여 메모리 오염 유발
🛡️ 대응 방법
영향받는 Linux 커널 버전을 최신 패치가 적용된 버전으로 업데이트
🔧 검증 코드
명령어가 aml_sfc_dma_buffer_setup 함수를 찾으면 드라이버가 시스템에 존재하며, 실제 패치 여부는 커널 소스 코드의 해당 함수 오류 처리 로직 검토 필요
grep -r 'aml_sfc_dma_buffer_setup' /usr/src/linux-headers-$(uname -r)/drivers/spi/ 2>/dev/null || echo 'Driver not found locally'