🇰🇷 한글 설명
Linux 커널의 ext4 파일 시스템에서 ext4_find_extent() 함수 호출 시 경로 메모리 재할당 후 원본 경로 포인터(*orig_path)를 업데이트하지 않는 취약점이 발견되었습니다. 이로 인해 호출자가 유효하지 않은 NULL 포인터를 참조하게 되어 커널 패닉(NULL pointer dereference)이 발생하거나 메모리 누수가 발생할 수 있습니다.
💡 쉬운 설명
파일 시스템이 데이터를 찾는 과정에서 메모리 공간이 부족해 크기를 늘렸는데, 새로 만든 주소를 제대로 기록하지 않아 컴퓨터가 엉뚱한 곳을 참조하며 멈추는 문제입니다. 이로 인해 시스템이 갑자기 꺼지거나 메모리가 낭비될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ext4: update orig_path in ext4_find_extent()
In ext4_find_extent(), if the path is not big enough, we free it and set
*orig_path to NULL. But after reallocating and successfully initializing
the path, we don't update *orig_path, in which case the caller gets a
valid path but a NULL ppath, and this may cause a NULL pointer dereference
or a path memory leak. For example:
ext4_split_extent
path = *ppath = 2000
ext4_find_extent
if (depth > path[0].p_maxdepth)
kfree(path = 2000);
*orig_path = path = NULL;
path = kcalloc() = 3000
ext4_split_extent_at(*ppath = NULL)
path = *ppath;
ex = path[depth].p_ext;
// NULL pointer dereference!
==================================================================
BUG: kernel NULL pointer dereference, address: 0000000000000010
CPU: 6 UID: 0 PID: 576 Comm: fsstress Not tainted 6.11.0-rc2-dirty #847
RIP: 0010:ext4_split_extent_at+0x6d/0x560
Call Trace:
<TASK>
ext4_split_extent.isra.0+0xcb/0x1b0
ext4_ext_convert_to_initialized+0x168/0x6c0
ext4_ext_handle_unwritten_extents+0x325/0x4d0
ext4_ext_map_blocks+0x520/0xdb0
ext4_map_blocks+0x2b0/0x690
ext4_iomap_begin+0x20e/0x2c0
[...]
==================================================================
Therefore, *orig_path is updated when the extent lookup succeeds, so that
the caller can safely use path or *ppath.
📍 영향받는 시스템
Linux kernel (ext4 파일 시스템을 사용하는 버전, 특히 6.11.0-rc2 이전 버전)
⚔️ 공격 벡터
특수하게 조작된 파일 시스템 구조를 통해 ext4의 extent 탐색 로직을 트리거하여 커널 오류 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 ext4_find_extent()의 포인터 업데이트 로직을 수정해야 함
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 최신 패치 버전인지 확인