🇰🇷 한글 설명
Linux 커널의 F2FS 파일 시스템에서 FGGC(Foreground Garbage Collection) 노드 블록 마이그레이션 중 fsck 불일치 문제가 발생합니다. 가비지 컬렉션 과정에서 마이그레이션된 노드 블록의 dentry 및 fsync 마크가 제대로 삭제되지 않아, fsck가 이를 사용자 데이터로 오인할 수 있는 취약점입니다.
💡 쉬운 설명
파일 시스템의 정리 작업 중에 데이터의 상태 표시를 제대로 지우지 않아, 검사 도구가 데이터를 잘못 해석하는 문제입니다. 이로 인해 파일 시스템의 데이터 무결성이 깨질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix fsck inconsistency caused by FGGC of node block
During FGGC node block migration, fsck may incorrectly treat the
migrated node block as fsync-written data.
The reproduction scenario:
root@vm:/mnt/f2fs# seq 1 2048 | xargs -n 1 ./test_sync // write inline inode and sync
root@vm:/mnt/f2fs# rm -f 1
root@vm:/mnt/f2fs# sync
root@vm:/mnt/f2fs# f2fs_io gc_range // move data block in sync mode and not write CP
SPO, "fsck --dry-run" find inode has already checkpointed but still
with DENT_BIT_SHIFT set
The root cause is that GC does not clear the dentry mark and fsync mark
during node block migration, leading fsck to misinterpret them as
user-issued fsync writes.
In BGGC mode, node block migration is handled by f2fs_sync_node_pages(),
which guarantees the dentry and fsync marks are cleared before writing.
This patch move the set/clear of the fsync|dentry marks into
__write_node_folio to make the logic clearer, and ensures the
fsync|dentry mark is cleared in FGGC.
📍 영향받는 시스템
Linux kernel (F2FS 파일 시스템을 사용하는 시스템)
⚔️ 공격 벡터
직접적인 외부 공격보다는 특정 파일 시스템 작업(FGGC) 및 fsck 실행 시 데이터 불일치 유발
🛡️ 대응 방법
F2FS 노드 블록 마이그레이션 로직이 수정된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 버전인지 확인