🇰🇷 한글 설명
Linux 커널의 f2fs 파일 시스템에서 여러 인스턴스가 동시에 실행될 때 fsync_entry_slab 포인터에 접근하며 발생하는 레이스 컨디션 취약점입니다. 이로 인해 f2fs 복구 과정에서 Use-After-Free(UAF) 문제가 발생하여 시스템 안정성이 저해될 수 있습니다.
💡 쉬운 설명
여러 개의 f2fs 저장 장치를 동시에 사용할 때, 시스템이 메모리를 관리하는 과정에서 충돌이 발생하여 이미 사용이 끝난 메모리 영역에 접근하는 오류입니다. 이 오류는 시스템을 불안정하게 만들거나 예기치 않은 동작을 유발할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to avoid racing on fsync_entry_slab by multi filesystem instances
As syzbot reported, there is an use-after-free issue during f2fs recovery:
Use-after-free write at 0xffff88823bc16040 (in kfence-#10):
kmem_cache_destroy+0x1f/0x120 mm/slab_common.c:486
f2fs_recover_fsync_data+0x75b0/0x8380 fs/f2fs/recovery.c:869
f2fs_fill_super+0x9393/0xa420 fs/f2fs/super.c:3945
mount_bdev+0x26c/0x3a0 fs/super.c:1367
legacy_get_tree+0xea/0x180 fs/fs_context.c:592
vfs_get_tree+0x86/0x270 fs/super.c:1497
do_new_mount fs/namespace.c:2905 [inline]
path_mount+0x196f/0x2be0 fs/namespace.c:3235
do_mount fs/namespace.c:3248 [inline]
__do_sys_mount fs/namespace.c:3456 [inline]
__se_sys_mount+0x2f9/0x3b0 fs/namespace.c:3433
do_syscall_64+0x3f/0xb0 arch/x86/entry/common.c:47
entry_SYSCALL_64_after_hwframe+0x44/0xae
The root cause is multi f2fs filesystem instances can race on accessing
global fsync_entry_slab pointer, result in use-after-free issue of slab
cache, fixes to init/destroy this slab cache only once during module
init/destroy procedure to avoid this issue.
📍 영향받는 시스템
Linux kernel (f2fs module 사용 환경)
⚔️ 공격 벡터
로컬 공격자가 악의적으로 조작된 f2fs 파일 시스템을 마운트하여 레이스 컨디션을 유도함으로써 발생 가능
🛡️ 대응 방법
f2fs 모듈의 초기화 및 해제 절차를 수정하여 slab 캐시가 한 번만 생성 및 삭제되도록 업데이트된 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 f2fs 레이스 컨디션 패치가 적용된 최신 보안 업데이트 버전인지 확인