🔍 CVE-2026-23249

5.5
CVSS Score
MEDIUM
2026-03-18
2026-11-05 22:18
✅ 완료

🇰🇷 한글 설명

Linux 커널 XFS 파일시스템의 btree 복구 함수에서 첫 번째 트리 검증 중 오류로 인해 두 번째 트리의 커서가 무효화되어 NULL 포인터 역참조가 발생하는 취약점입니다. 디스크 검증/복구 작업 중 시스템 패닉을 유발합니다.

💡 쉬운 설명

XFS 파일시스템 수리 도구가 두 개의 트리를 검사할 때 첫 번째 검사 실패로 두 번째 검사가 죽으면서 커널이 충돌합니다. 로컬 공격자가 손상된 파일시스템을 복구하려다 시스템을 마비시킬 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: xfs: check for deleted cursors when revalidating two btrees The free space and inode btree repair functions will rebuild both btrees at the same time, after which it needs to evaluate both btrees to confirm that the corruptions are gone. However, Jiaming Zhang ran syzbot and produced a crash in the second xchk_allocbt call. His root-cause analysis is as follows (with minor corrections): In xrep_revalidate_allocbt(), xchk_allocbt() is called twice (first for BNOBT, second for CNTBT). The cause of this issue is that the first call nullified the cursor required by the second call. Let's first enter xrep_revalidate_allocbt() via following call chain: xfs_file_ioctl() -> xfs_ioc_scrubv_metadata() -> xfs_scrub_metadata() -> `sc->ops->repair_eval(sc)` -> xrep_revalidate_allocbt() xchk_allocbt() is called twice in this function. In the first call: /* Note that sc->sm->sm_type is XFS_SCRUB_TYPE_BNOPT now */ xchk_allocbt() -> xchk_btree() -> `bs->scrub_rec(bs, recp)` -> xchk_allocbt_rec() -> xchk_allocbt_xref() -> xchk_allocbt_xref_other() since sm_type is XFS_SCRUB_TYPE_BNOBT, pur is set to &sc->sa.cnt_cur. Kernel called xfs_alloc_get_rec() and returned -EFSCORRUPTED. Call chain: xfs_alloc_get_rec() -> xfs_btree_get_rec() -> xfs_btree_check_block() -> (XFS_IS_CORRUPT || XFS_TEST_ERROR), the former is false and the latter is true, return -EFSCORRUPTED. This should be caused by ioctl$XFS_IOC_ERROR_INJECTION I guess. Back to xchk_allocbt_xref_other(), after receiving -EFSCORRUPTED from xfs_alloc_get_rec(), kernel called xchk_should_check_xref(). In this function, *curpp (points to sc->sa.cnt_cur) is nullified. Back to xrep_revalidate_allocbt(), since sc->sa.cnt_cur has been nullified, it then triggered null-ptr-deref via xchk_allocbt() (second call) -> xchk_btree(). So. The bnobt revalidation failed on a cross-reference attempt, so we deleted the cntbt cursor, and then crashed when we tried to revalidate the cntbt. Therefore, check for a null cntbt cursor before that revalidation, and mark the repair incomplete. Also we can ignore the second tree entirely if the first tree was rebuilt but is already corrupt. Apply the same fix to xrep_revalidate_iallocbt because it has the same problem.

📍 영향받는 시스템

Linux 커널 (xfs 파일시스템 사용) - RHEL, CentOS, Fedora, Ubuntu 등의 서버 환경

⚔️ 공격 벡터

로컬 사용자가 손상된 XFS 파일시스템에 대해 xfs_scrub/xfs_repair 실행 또는 xfs_ioc_scrubv_metadata ioctl 호출

🛡️ 대응 방법

Linux 커널을 최신 버전으로 업데이트 (xfs btree 커서 검증 패치 포함 버전으로)

🔧 검증 코드

커널 버전과 XFS 파일시스템 활성화 여부를 확인합니다. XFS가 있는 경우 패치 버전 확인 후 xfs_scrub 실행 시 패닉이 없는지 테스트하세요.

Shell / Script
uname -r && grep xfs /proc/filesystems 2>/dev/null

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

💻 영향받는 소프트웨어

Linux Kernel