🇰🇷 한글 설명
Linux 커널의 F2FS 파일 시스템에서 유효 노드 카운트가 0으로 조작될 경우 f2fs_bug_on()이 호출되어 시스템 패닉이 발생하는 취약점입니다. 이 패치는 시스템 중단 대신 경고를 출력하고 파일 시스템 체크(FSCK)가 필요하도록 설정하여 안정성을 높였습니다.
💡 쉬운 설명
파일 시스템의 데이터 개수를 세는 과정에서 숫자가 잘못되어 시스템이 갑자기 멈춰버리는 문제입니다. 이 문제는 시스템을 강제로 종료하는 대신, 오류를 기록하고 점검을 요청하도록 수정되었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to avoid f2fs_bug_on() in dec_valid_node_count()
As Yanming reported in bugzilla:
https://bugzilla.kernel.org/show_bug.cgi?id=215897
I have encountered a bug in F2FS file system in kernel v5.17.
The kernel should enable CONFIG_KASAN=y and CONFIG_KASAN_INLINE=y. You can
reproduce the bug by running the following commands:
The kernel message is shown below:
kernel BUG at fs/f2fs/f2fs.h:2511!
Call Trace:
f2fs_remove_inode_page+0x2a2/0x830
f2fs_evict_inode+0x9b7/0x1510
evict+0x282/0x4e0
do_unlinkat+0x33a/0x540
__x64_sys_unlinkat+0x8e/0xd0
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae
The root cause is: .total_valid_block_count or .total_valid_node_count
could fuzzed to zero, then once dec_valid_node_count() was called, it
will cause BUG_ON(), this patch fixes to print warning info and set
SBI_NEED_FSCK into CP instead of panic.
📍 영향받는 시스템
Linux kernel v5.17 및 F2FS 파일 시스템을 사용하는 시스템
⚔️ 공격 벡터
파일 시스템의 메타데이터(유효 블록/노드 카운트)를 조작하여 커널 패닉 유도
🛡️ 대응 방법
F2FS 관련 수정 사항이 포함된 최신 Linux 커널 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 패치 버전인지 확인