🔍 CVE-2026-31702

7.8
CVSS Score
HIGH
2026-05-01
2026-06-01 17:16
✅ 완료

🇰🇷 한글 설명

Linux 커널의 F2FS 파일 시스템에서 f2fs_compress_write_end_io() 함수 호출 중 Use-After-Free 취약점이 발견되었습니다. 언마운트 과정에서 sbi 객체가 해제된 후, 동시에 실행 중인 BIO 완료 콜백이 이미 파괴된 슬랩 캐시를 참조하여 발생합니다.

💡 쉬운 설명

파일 시스템을 분리(언마운트)하는 도중에 데이터 쓰기 작업이 동시에 끝나면서, 이미 삭제된 메모리 영역을 다시 사용하려고 시도하는 오류입니다. 이로 인해 시스템이 충돌하거나 보안 문제가 발생할 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: f2fs: fix use-after-free of sbi in f2fs_compress_write_end_io() In f2fs_compress_write_end_io(), dec_page_count(sbi, type) can bring the F2FS_WB_CP_DATA counter to zero, unblocking f2fs_wait_on_all_pages() in f2fs_put_super() on a concurrent unmount CPU. The unmount path then proceeds to call f2fs_destroy_page_array_cache(sbi), which destroys sbi->page_array_slab via kmem_cache_destroy(), and eventually kfree(sbi). Meanwhile, the bio completion callback is still executing: when it reaches page_array_free(sbi, ...), it dereferences sbi->page_array_slab — a destroyed slab cache — to call kmem_cache_free(), causing a use-after-free. This is the same class of bug as CVE-2026-23234 (which fixed the equivalent race in f2fs_write_end_io() in data.c), but in the compressed writeback completion path that was not covered by that fix. Fix this by moving dec_page_count() to after page_array_free(), so that all sbi accesses complete before the counter decrement that can unblock unmount. For non-last folios (where atomic_dec_return on cic->pending_pages is nonzero), dec_page_count is called immediately before returning — page_array_free is not reached on this path, so there is no post-decrement sbi access. For the last folio, page_array_free runs while the F2FS_WB_CP_DATA counter is still nonzero (this folio has not yet decremented it), keeping sbi alive, and dec_page_count runs as the final operation.

📍 영향받는 시스템

Linux kernel (F2FS 파일 시스템을 사용하는 버전)

⚔️ 공격 벡터

로컬 공격자가 특정 파일 시스템 작업(압축 쓰기 및 언마운트)을 동시에 수행하여 메모리 오류 유도

🛡️ 대응 방법

Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.

🔧 검증 코드

출력된 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인하십시오.

Shell / Script
uname -r

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

💻 영향받는 소프트웨어

Linux Kernel