🇰🇷 한글 설명
Linux 커널의 NILFS2 파일 시스템에서 로그 작성 중 오류가 발생할 경우 상태 관리가 제대로 이루어지지 않는 취약점입니다. 이로 인해 페이지 캐시 작업이 중단되어 시스템이 멈추거나, 파일 시스템의 블록 매핑이 손상되어 데이터가 유실될 수 있습니다.
💡 쉬운 설명
파일을 저장하는 과정에서 오류가 났을 때 뒷정리가 제대로 되지 않아 컴퓨터가 멈추거나 파일이 깨질 수 있는 문제입니다. 시스템이 오류 상황을 제대로 처리하지 못해 발생하는 결함입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
nilfs2: fix state management in error path of log writing function
After commit a694291a6211 ("nilfs2: separate wait function from
nilfs_segctor_write") was applied, the log writing function
nilfs_segctor_do_construct() was able to issue I/O requests continuously
even if user data blocks were split into multiple logs across segments,
but two potential flaws were introduced in its error handling.
First, if nilfs_segctor_begin_construction() fails while creating the
second or subsequent logs, the log writing function returns without
calling nilfs_segctor_abort_construction(), so the writeback flag set on
pages/folios will remain uncleared. This causes page cache operations to
hang waiting for the writeback flag. For example,
truncate_inode_pages_final(), which is called via nilfs_evict_inode() when
an inode is evicted from memory, will hang.
Second, the NILFS_I_COLLECTED flag set on normal inodes remain uncleared.
As a result, if the next log write involves checkpoint creation, that's
fine, but if a partial log write is performed that does not, inodes with
NILFS_I_COLLECTED set are erroneously removed from the "sc_dirty_files"
list, and their data and b-tree blocks may not be written to the device,
corrupting the block mapping.
Fix these issues by uniformly calling nilfs_segctor_abort_construction()
on failure of each step in the loop in nilfs_segctor_do_construct(),
having it clean up logs and segment usages according to progress, and
correcting the conditions for calling nilfs_redirty_inodes() to ensure
that the NILFS_I_COLLECTED flag is cleared.
📍 영향받는 시스템
NILFS2 파일 시스템을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
특정 조건에서 파일 시스템 로그 작성 중 오류를 유발하여 시스템 중단 또는 데이터 손상 유도
🛡️ 대응 방법
NILFS2 관련 패치가 적용된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인