🇰🇷 한글 설명
Linux 커널의 ext4 파일 시스템에서 ext4_read_inline_dir() 함수가 인라인 버퍼의 범위를 벗어나 데이터를 읽는 취약점이 발견되었습니다. 이로 인해 getdents64() 호출 시 slab-out-of-bounds read가 발생하여 시스템 안정성에 영향을 줄 수 있습니다.
💡 쉬운 설명
파일 목록을 읽어오는 과정에서 정해진 메모리 공간보다 더 많은 데이터를 읽으려고 시도하는 오류입니다. 이로 인해 컴퓨터의 중요한 정보가 유출되거나 시스템이 멈출 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ext4: fix out-of-bounds read in ext4_read_inline_dir()
ext4_read_inline_dir() can read a dirent header past the end of its inline
buffer, triggering a slab-out-of-bounds read during getdents64():
BUG: KASAN: slab-out-of-bounds in __ext4_check_dir_entry
Read of size 2 at addr ffff88800f3dd23c by task exploit/148
...
__ext4_check_dir_entry
ext4_read_inline_dir
iterate_dir
The dirent payload lives in a buffer of exactly inline_size bytes:
dir_buf = kmalloc(inline_size, GFP_NOFS);
but iteration runs in a position space extra_offset bytes larger
(extra_size = extra_offset + inline_size) so the synthetic "." and ".."
land at their block-dir offsets. A dirent is formed at "dir_buf + pos -
extra_offset", yet the ext4_check_dir_entry() length argument uses the
larger extra_size. A position whose dirent header would extend past
extra_size is therefore accepted, and the rescan loop's rec_len probe and
ext4_check_dir_entry() dereference de->rec_len before the entry is rejected.
Reject a position whose minimum-size dirent header would not fit within
extra_size before forming de, in both the rescan and main loops, and pass
inline_size rather than extra_size to ext4_check_dir_entry() so the length
check matches the physical buffer.
📍 영향받는 시스템
Linux kernel (ext4 파일 시스템을 사용하는 모든 버전)
⚔️ 공격 벡터
조작된 파일 시스템 구조를 통해 getdents64() 시스템 호출을 유도하여 메모리 경계를 넘어서는 읽기 수행
🛡️ 대응 방법
ext4 관련 보안 패치가 적용된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 최신 보안 패치 버전인지 확인