🇰🇷 한글 설명
Linux 커널의 EROFS 파일 시스템에서 z_erofs_decompress_kickoff 함수가 파일 시스템 언마운트 과정과 경합을 일으켜 Use-After-Free(UAF) 취약점이 발생합니다. I/O 완료 후 비동기 작업이 실행되는 과정에서 파일 시스템 구조체(sbi)가 먼저 해제되어 메모리 오류가 발생할 수 있습니다.
💡 쉬운 설명
파일 시스템을 사용 중 해제할 때, 데이터 압축을 푸는 작업이 아직 끝나지 않았는데 메모리가 먼저 삭제되어 발생하는 오류입니다. 이로 인해 시스템이 충돌하거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
erofs: fix use-after-free on sbi->sync_decompress
z_erofs_decompress_kickoff() can race with filesystem unmount, causing
a use-after-free on sbi->sync_decompress.
When I/O completes, z_erofs_endio() calls z_erofs_decompress_kickoff()
to queue z_erofs_decompressqueue_work() asynchronously. Then, after all
folios are unlocked, unmount workflow can proceed and sbi will be freed
before accessing to sbi->sync_decompress.
Thread (unmount) I/O completion kworker
queue_work
z_erofs_decompressqueue_work
(all folios are unlocked)
cleanup_mnt
..
erofs_kill_sb
erofs_sb_free
kfree(sbi)
access sbi->sync_decompress // UAF!!
📍 영향받는 시스템
Linux kernel (EROFS 파일 시스템을 사용하는 시스템)
⚔️ 공격 벡터
특수하게 조작된 I/O 작업과 동시에 파일 시스템 언마운트를 유도하여 메모리 오류 발생
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.