🇰🇷 한글 설명
Linux 커널의 F2FS 파일 시스템에서 umount() 과정 중 cp_error가 설정된 경우, 모든 더티 페이지를 드롭하지 않아 발생하는 커널 버그입니다. 이로 인해 f2fs_wait_on_all_pages() 이후에도 fsync_node_num이 0이 되지 않아 커널 패닉(BUG)이 발생할 수 있습니다.
💡 쉬운 설명
파일 시스템을 안전하게 분리(unmount)하는 과정에서 데이터 처리 오류가 발생할 때, 시스템이 이를 제대로 정리하지 못해 컴퓨터가 멈추거나 오류를 일으키는 문제입니다. 특정 상황에서 데이터 저장 과정이 꼬이면서 운영체제의 핵심인 커널이 충돌하게 됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to drop all dirty pages during umount() if cp_error is set
xfstest generic/361 reports a bug as below:
f2fs_bug_on(sbi, sbi->fsync_node_num);
kernel BUG at fs/f2fs/super.c:1627!
RIP: 0010:f2fs_put_super+0x3a8/0x3b0
Call Trace:
generic_shutdown_super+0x8c/0x1b0
kill_block_super+0x2b/0x60
kill_f2fs_super+0x87/0x110
deactivate_locked_super+0x39/0x80
deactivate_super+0x46/0x50
cleanup_mnt+0x109/0x170
__cleanup_mnt+0x16/0x20
task_work_run+0x65/0xa0
exit_to_user_mode_prepare+0x175/0x190
syscall_exit_to_user_mode+0x25/0x50
do_syscall_64+0x4c/0x90
entry_SYSCALL_64_after_hwframe+0x72/0xdc
During umount(), if cp_error is set, f2fs_wait_on_all_pages() should
not stop waiting all F2FS_WB_CP_DATA pages to be writebacked, otherwise,
fsync_node_num can be non-zero after f2fs_wait_on_all_pages() causing
this bug.
In this case, to avoid deadloop in f2fs_wait_on_all_pages(), it needs
to drop all dirty pages rather than redirtying them.
📍 영향받는 시스템
F2FS 파일 시스템을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
로컬 공격자가 파일 시스템의 오류 상태(cp_error)를 유도하여 커널 패닉을 일으키는 방식
🛡️ 대응 방법
F2FS 관련 수정 사항이 포함된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 버전인지 확인합니다.