🇰🇷 한글 설명
Linux kernel XFS 파일시스템에서 superblock이 log stripe unit을 미지정할 때 roundoff 값이 512로 설정되어 4K sector 디스크에서 로그 손상 및 마운트 실패를 초래합니다.
💡 쉬운 설명
XFS 파일시스템의 설정 오류로 인해 저장된 데이터가 손상되어 리눅스 부팅 시 파일시스템을 읽을 수 없게 되는 문제입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
xfs: fix undersized l_iclog_roundoff values
If the superblock doesn't list a log stripe unit, we set the incore log
roundoff value to 512. This leads to corrupt logs and unmountable
filesystems in generic/617 on a disk with 4k physical sectors...
XFS (sda1): Mounting V5 Filesystem ff3121ca-26e6-4b77-b742-aaff9a449e1c
XFS (sda1): Torn write (CRC failure) detected at log block 0x318e. Truncating head block from 0x3197.
XFS (sda1): failed to locate log tail
XFS (sda1): log mount/recovery failed: error -74
XFS (sda1): log mount failed
XFS (sda1): Mounting V5 Filesystem ff3121ca-26e6-4b77-b742-aaff9a449e1c
XFS (sda1): Ending clean mount
...on the current xfsprogs for-next which has a broken mkfs. xfs_info
shows this...
meta-data=/dev/sda1 isize=512 agcount=4, agsize=644992 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=1
= reflink=1 bigtime=1 inobtcount=1 nrext64=1
= exchange=1 metadir=1
data = bsize=4096 blocks=2579968, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1, parent=1
log =internal log bsize=4096 blocks=16384, version=2
= sectsz=4096 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
= rgcount=0 rgsize=268435456 extents
= zoned=0 start=0 reserved=0
...observe that the log section has sectsz=4096 sunit=0, which means
that the roundoff factor is 512, not 4096 as you'd expect. We should
fix mkfs not to generate broken filesystems, but anyone can fuzz the
ondisk superblock so we should be more cautious. I think the inadequate
logic predates commit a6a65fef5ef8d0, but that's clearly going to
require a different backport.
📍 영향받는 시스템
XFS 파일시스템을 사용하는 모든 Linux 시스템 (Red Hat, CentOS, Fedora 등 특히 4K sector 물리 디스크 환경)
⚔️ 공격 벡터
superblock 손상/조작 또는 잘못된 파일시스템 생성(mkfs.xfs) 설정을 통한 간접 Denial of Service
🛡️ 대응 방법
kernel 업데이트 또는 xfs/log.c 패치를 적용하여 roundoff 값을 4096으로 수정
🔧 검증 코드
log 섹션에서 sunit이 0이 아니고 sectsz와 일치하면 정상, sunit=0이면 취약한 상태
xfs_info / 2>/dev/null | grep -A2 'log' | grep -E 'sunit|sectsz'