🇰🇷 한글 설명
Linux 커널의 F2FS 파일 시스템에서 f2fs_do_zero_range() 함수 호출 시 블록 주소에 대한 유효성 검사가 누락되어 발생하는 취약점입니다. 퍼징된 이미지를 통해 inode의 블록 매핑 정보와 SIT 테이블 간의 불일치를 유도할 경우, 잘못된 블록 주소로 SIT를 업데이트하려다 커널 패닉이 발생할 수 있습니다.
💡 쉬운 설명
파일 시스템의 특정 데이터 관리 방식에 오류가 있어, 조작된 파일을 사용하면 컴퓨터 시스템이 갑자기 멈추거나 꺼질 수 있는 문제입니다. 공격자가 특수하게 만들어진 파일을 시스템에 올리면 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to do sanity check on block address in f2fs_do_zero_range()
As Yanming reported in bugzilla:
https://bugzilla.kernel.org/show_bug.cgi?id=215894
I have encountered a bug in F2FS file system in kernel v5.17.
I have uploaded the system call sequence as case.c, and a fuzzed image can
be found in google net disk
The kernel should enable CONFIG_KASAN=y and CONFIG_KASAN_INLINE=y. You can
reproduce the bug by running the following commands:
kernel BUG at fs/f2fs/segment.c:2291!
Call Trace:
f2fs_invalidate_blocks+0x193/0x2d0
f2fs_fallocate+0x2593/0x4a70
vfs_fallocate+0x2a5/0xac0
ksys_fallocate+0x35/0x70
__x64_sys_fallocate+0x8e/0xf0
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae
The root cause is, after image was fuzzed, block mapping info in inode
will be inconsistent with SIT table, so in f2fs_fallocate(), it will cause
panic when updating SIT with invalid blkaddr.
Let's fix the issue by adding sanity check on block address before updating
SIT table with it.
📍 영향받는 시스템
Linux Kernel v5.17 및 F2FS 파일 시스템을 사용하는 시스템
⚔️ 공격 벡터
조작된(fuzzed) 파일 시스템 이미지를 마운트하거나 특정 시스템 호출(fallocate)을 유도하여 커널 패닉 유발
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 f2fs_do_zero_range()의 유효성 검사 로직을 적용해야 함
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 패치 버전 이후인지 확인합니다.