🇰🇷 한글 설명
Linux 커널의 F2FS 파일 시스템에서 손상된 디렉토리에 대해 온라인 복구를 시도하는 과정 중 발생하는 취약점입니다. 읽기 전용(readonly) 재마운트와 경합이 발생할 경우 더티 데이터/메타데이터가 남게 되며, 체크포인트 과정에서 이를 처리하지 못해 커널 패닉이 발생할 수 있습니다.
💡 쉬운 설명
파일 시스템에 오류가 있을 때 자동으로 고치려다 오히려 시스템이 멈춰버리는 버그입니다. 파일 시스템이 읽기 전용 모드로 바뀔 때 처리되지 못한 데이터가 남아 컴퓨터가 갑자기 꺼질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
f2fs: get rid of online repaire on corrupted directory
syzbot reports a f2fs bug as below:
kernel BUG at fs/f2fs/inode.c:896!
RIP: 0010:f2fs_evict_inode+0x1598/0x15c0 fs/f2fs/inode.c:896
Call Trace:
evict+0x532/0x950 fs/inode.c:704
dispose_list fs/inode.c:747 [inline]
evict_inodes+0x5f9/0x690 fs/inode.c:797
generic_shutdown_super+0x9d/0x2d0 fs/super.c:627
kill_block_super+0x44/0x90 fs/super.c:1696
kill_f2fs_super+0x344/0x690 fs/f2fs/super.c:4898
deactivate_locked_super+0xc4/0x130 fs/super.c:473
cleanup_mnt+0x41f/0x4b0 fs/namespace.c:1373
task_work_run+0x24f/0x310 kernel/task_work.c:228
ptrace_notify+0x2d2/0x380 kernel/signal.c:2402
ptrace_report_syscall include/linux/ptrace.h:415 [inline]
ptrace_report_syscall_exit include/linux/ptrace.h:477 [inline]
syscall_exit_work+0xc6/0x190 kernel/entry/common.c:173
syscall_exit_to_user_mode_prepare kernel/entry/common.c:200 [inline]
__syscall_exit_to_user_mode_work kernel/entry/common.c:205 [inline]
syscall_exit_to_user_mode+0x279/0x370 kernel/entry/common.c:218
do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0010:f2fs_evict_inode+0x1598/0x15c0 fs/f2fs/inode.c:896
Online repaire on corrupted directory in f2fs_lookup() can generate
dirty data/meta while racing w/ readonly remount, it may leave dirty
inode after filesystem becomes readonly, however, checkpoint() will
skips flushing dirty inode in a state of readonly mode, result in
above panic.
Let's get rid of online repaire in f2fs_lookup(), and leave the work
to fsck.f2fs.
📍 영향받는 시스템
Linux Kernel (F2FS 파일 시스템을 사용하는 시스템)
⚔️ 공격 벡터
손상된 디렉토리를 포함한 F2FS 파일 시스템을 마운트하거나 읽기 전용 재마운트 시도를 유도하여 커널 패닉 유발
🛡️ 대응 방법
F2FS 온라인 복구 기능을 제거하고 fsck.f2fs를 사용하도록 수정된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 버전인지 확인하십시오.