🇰🇷 한글 설명
Linux 커널의 ext4 파일 시스템에서 INLINE_DATA와 EXTENTS 플래그가 동시에 설정된 잘못된 inode를 처리할 때 발생하는 취약점입니다. 저널링 없이 마운트된 손상된 파일 시스템에서 verity 파일을 열 때, 유효하지 않은 익스텐트 트리로 인해 커널의 BUG_ON이 트리거되어 시스템이 중단될 수 있습니다.
💡 쉬운 설명
파일 저장 방식이 서로 충돌하는 잘못된 데이터가 들어있을 때, 컴퓨터의 핵심 운영체제(커널)가 이를 처리하지 못하고 멈춰버리는 문제입니다. 파일 시스템이 손상된 상태에서 특정 파일을 열려고 하면 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ext4: detect invalid INLINE_DATA + EXTENTS flag combination
syzbot reported a BUG_ON in ext4_es_cache_extent() when opening a verity
file on a corrupted ext4 filesystem mounted without a journal.
The issue is that the filesystem has an inode with both the INLINE_DATA
and EXTENTS flags set:
EXT4-fs error (device loop0): ext4_cache_extents:545: inode #15:
comm syz.0.17: corrupted extent tree: lblk 0 < prev 66
Investigation revealed that the inode has both flags set:
DEBUG: inode 15 - flag=1, i_inline_off=164, has_inline=1, extents_flag=1
This is an invalid combination since an inode should have either:
- INLINE_DATA: data stored directly in the inode
- EXTENTS: data stored in extent-mapped blocks
Having both flags causes ext4_has_inline_data() to return true, skipping
extent tree validation in __ext4_iget(). The unvalidated out-of-order
extents then trigger a BUG_ON in ext4_es_cache_extent() due to integer
underflow when calculating hole sizes.
Fix this by detecting this invalid flag combination early in ext4_iget()
and rejecting the corrupted inode.
📍 영향받는 시스템
Linux kernel (ext4 filesystem 사용 시스템)
⚔️ 공격 벡터
손상된 ext4 파일 시스템을 마운트하거나 특정 조건의 verity 파일을 열어 커널 패닉 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 ext4 플래그 검증 로직 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인