🇰🇷 한글 설명
Linux 커널의 decompress 모듈에서 module_extend_max_pages() 함수의 반환 값을 확인하지 않아 발생하는 취약점입니다. 메모리 할당 실패 시 NULL 포인터가 적절히 처리되지 않아 ZERO_SIZE_PTR 역참조가 발생하며, 이로 인해 커널 오류(Kernel Oops)가 유발될 수 있습니다.
💡 쉬운 설명
컴퓨터의 핵심 운영체제인 리눅스에서 메모리를 빌려오는 과정 중 오류가 발생했을 때, 이를 제대로 확인하지 않고 계속 진행하려다 시스템이 멈추거나 오류가 발생하는 문제입니다. 메모리가 부족한 상황에서 시스템이 예상치 못한 동작을 하게 만듭니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
module: decompress: check return value of module_extend_max_pages()
module_extend_max_pages() calls kvrealloc() internally and returns
-ENOMEM on allocation failure. The return value is never checked.
If the initial allocation fails, info->pages remains NULL and
info->max_pages remains 0. Subsequent calls to module_get_next_page()
will attempt to dynamically grow the array by calling
module_extend_max_pages(info, 0) since info->used_pages is 0. This
results in kvrealloc(NULL, 0) returning ZERO_SIZE_PTR, which is treated
as a success, leading to a dereference of ZERO_SIZE_PTR and a kernel
oops.
Fix: add the missing error check after module_extend_max_pages() and
return immediately on failure. This matches the pattern used by every
other kvrealloc() caller in the module loading path.
[Sami: Corrected the analysis in the commit message.]
📍 영향받는 시스템
Linux kernel (decompress module 포함 버전)
⚔️ 공격 벡터
메모리 할당 실패를 유도하여 커널 오류(Kernel Oops)를 발생시키는 로컬 공격
🛡️ 대응 방법
module_extend_max_pages()의 반환 값을 체크하도록 커널을 최신 패치 버전으로 업데이트
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.