🇰🇷 한글 설명
Linux 커널의 XFS 파일 시스템에서 로그 복구 과정 중 버퍼 로그 아이템의 더티 비트맵 경계 검사 미흡으로 인해 발생하는 취약점입니다. 공격자가 조작된 파일 시스템 이미지를 마운트하게 유도할 경우, memcpy() 함수가 할당된 버퍼 범위를 초과하여 커널 힙 메모리를 오염시킬 수 있습니다.
💡 쉬운 설명
나쁜 의도를 가진 사람이 만든 특수한 저장 장치(USB 등)를 컴퓨터에 연결하면, 컴퓨터의 핵심 메모리 영역이 망가질 수 있는 보안 결함입니다. 이 결함은 시스템의 관리자 권한을 탈취하거나 시스템을 멈추게 할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
xfs: bounds-check buffer log item's dirty bitmap
xlog_recover_do_reg_buffer() replays each dirty region described by a
buffer log item's bitmap into the buffer read for that item:
memcpy(xfs_buf_offset(bp, (uint)bit << XFS_BLF_SHIFT),
item->ri_buf[i].iov_base,
nbits << XFS_BLF_SHIFT);
The destination offset (bit/nbits, from the logged dirty bitmap) and the
buffer size (from the logged blf_len) are both attacker-controlled and
otherwise unrelated, yet the only thing bounding the copy is an ASSERT(),
which compiles away on production kernels. A crafted image logging a
small blf_len together with a bitmap bit past the end of that buffer
drives the memcpy() past the buffer's allocation, corrupting adjacent
kernel heap during mount-time log recovery. This is reachable by anyone
who can get a crafted image mounted -- the malicious-filesystem threat
model XFS already guards against elsewhere.
Turn the ASSERT() into a real XFS_IS_CORRUPT() check that aborts recovery
of the buffer with -EFSCORRUPTED, consistent with the validate-and-fail
idiom already used in xlog_recover_do_inode_buffer() and
xfs_dquot_item_recover.c. xlog_recover_do_reg_buffer() therefore becomes
STATIC int and its three callers propagate the error.
Found and confirmed with KASAN on a CONFIG_XFS_DEBUG=n build: the crafted
image trips a slab-out-of-bounds write before this change and fails
recovery cleanly with -EFSCORRUPTED after it.
📍 영향받는 시스템
Linux Kernel (XFS 파일 시스템을 사용하는 모든 배포판)
⚔️ 공격 벡터
조작된 XFS 파일 시스템 이미지를 마운트하여 커널 힙 메모리 오버플로우 유도
🛡️ 대응 방법
XFS 로그 복구 로직에 경계 검사(XFS_IS_CORRUPT)가 포함된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인하십시오.