🇰🇷 한글 설명
ocfs2 파일시스템의 inode 읽기 시 inline data 크기 검증 누락으로 인한 use-after-free 취약점. 손상된 파일시스템에서 i_size가 실제 데이터 용량(id_count)을 초과할 경우 해제된 메모리 접근으로 시스템 충돌 또는 정보 유출.
💡 쉬운 설명
파일시스템 메타데이터 손상 시 파일 크기 정보가 잘못되어 이미 해제된 메모리에 접근하게 되고, 이는 시스템 충돌이나 정보 유출을 초래합니다. 파일시스템 읽기 시 크기 정보를 미리 검증하면 방지 가능합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: validate inline data i_size during inode read
When reading an inode from disk, ocfs2_validate_inode_block() performs
various sanity checks but does not validate the size of inline data. If
the filesystem is corrupted, an inode's i_size can exceed the actual
inline data capacity (id_count).
This causes ocfs2_dir_foreach_blk_id() to iterate beyond the inline data
buffer, triggering a use-after-free when accessing directory entries from
freed memory.
In the syzbot report:
- i_size was 1099511627576 bytes (~1TB)
- Actual inline data capacity (id_count) is typically <256 bytes
- A garbage rec_len (54648) caused ctx->pos to jump out of bounds
- This triggered a UAF in ocfs2_check_dir_entry()
Fix by adding a validation check in ocfs2_validate_inode_block() to ensure
inodes with inline data have i_size <= id_count. This catches the
corruption early during inode read and prevents all downstream code from
operating on invalid data.
📍 영향받는 시스템
Linux kernel ocfs2 파일시스템 지원 버전 (6.0 이전 대부분의 LTS kernel)
⚔️ 공격 벡터
조작되거나 손상된 ocfs2 파일시스템 마운트를 통해 kernel use-after-free 취약점 트리거
🛡️ 대응 방법
최신 Linux kernel 패치 적용 및 fsck.ocfs2로 파일시스템 무결성 검증
🔧 검증 코드
ocfs2가 출력되면 시스템이 ocfs2 지원하고 있으며, kernel 버전으로 해당 버전의 보안 패치 적용 여부 확인
grep -i ocfs2 /proc/filesystems && uname -r