🇰🇷 한글 설명
Linux 커널의 XFS 파일 시스템에서 reflink 플래그 교환 시 INO1_WRITTEN 설정이 되어 있으면 데이터 무결성이 깨질 수 있는 취약점입니다. 특정 조건에서 공유된 데이터 블록을 보호해야 하는 reflink 플래그가 잘못 제거되어, 이후 쓰기 작업 시 CoW(Copy-on-Write)가 작동하지 않아 데이터가 손상될 수 있습니다.
💡 쉬운 설명
파일의 내용을 서로 맞바꿀 때, 시스템이 데이터 보호를 위한 중요한 표시를 실수로 지워버리는 문제입니다. 이로 인해 나중에 파일을 수정할 때 다른 파일의 내용까지 함께 바뀌어 데이터가 망가질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
xfs: fix exchange-range reflink flag clearing issue with INO1_WRITTEN
When exchanging two full-file ranges, xmi_can_exchange_reflink_flags()
can move the reflink inode flag from the file that currently has it to
the other file, as long as exactly one side is marked. This assumes
that the file contents, and therefore all shared extents, are exchanged.
That assumption is not true when XFS_EXCHMAPS_INO1_WRITTEN is set.
xfs_exchmaps_can_skip_mapping() can skip hole and unwritten mappings
from file1, so an exchange can complete without moving every mapping
that the earlier flag-swap decision accounted for. In that case the
post-operation cleanup can clear the reflink flag from an inode that
still owns shared written extents. Later writes then take the
non-reflink write path and may update blocks that should still have
been protected by CoW, which shows up as data corruption between
reflink-related files.
Fix this by disabling the reflink flag exchange whenever
XFS_EXCHMAPS_INO1_WRITTEN is requested. The contents exchange can still
proceed; the conservative outcome is that both inodes keep the reflink
flag. The regular reflink flag cleanup path can drop the extra flag
later once the inode no longer has shared extents.
📍 영향받는 시스템
Linux kernel (XFS file system 사용 환경)
⚔️ 공격 벡터
로컬 사용자가 XFS 파일 시스템에서 reflink 기능을 사용하여 특정 파일 교환 작업을 수행할 때 발생 (데이터 손상 유도)
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.