🔍 CVE-2025-38059

5.5
CVSS Score
MEDIUM
2025-06-18
2026-10-30 13:18
✅ 완료

🇰🇷 한글 설명

Linux 커널 btrfs 파일시스템에서 rescue=idatacsums 마운트 옵션 사용 시 csum 트리가 로드되지 않은 상태에서 읽기 전용 scrub을 실행하면 NULL 포인터 역참조가 발생합니다. 이는 scrub 경로가 NO_DATA_CSUMS 상태 플래그를 확인하지 않아 발생하며, 수정 사항은 scrub 탐색 전에 extent 트리와 csum 트리 루트를 모두 검사하는 것입니다.

💡 쉬운 설명

특정 복구 옵션으로 마운트된 btrfs 파일시스템에서 scrub 검사를 실행하면 시스템이 비정상 종료될 수 있습니다. 공격자가 원격에서 악용하기보다는 서비스 중단을 유발할 수 있는 결함입니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: btrfs: avoid NULL pointer dereference if no valid csum tree [BUG] When trying read-only scrub on a btrfs with rescue=idatacsums mount option, it will crash with the following call trace: BUG: kernel NULL pointer dereference, address: 0000000000000208 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page CPU: 1 UID: 0 PID: 835 Comm: btrfs Tainted: G O 6.15.0-rc3-custom+ #236 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS unknown 02/02/2022 RIP: 0010:btrfs_lookup_csums_bitmap+0x49/0x480 [btrfs] Call Trace: <TASK> scrub_find_fill_first_stripe+0x35b/0x3d0 [btrfs] scrub_simple_mirror+0x175/0x290 [btrfs] scrub_stripe+0x5f7/0x6f0 [btrfs] scrub_chunk+0x9a/0x150 [btrfs] scrub_enumerate_chunks+0x333/0x660 [btrfs] btrfs_scrub_dev+0x23e/0x600 [btrfs] btrfs_ioctl+0x1dcf/0x2f80 [btrfs] __x64_sys_ioctl+0x97/0xc0 do_syscall_64+0x4f/0x120 entry_SYSCALL_64_after_hwframe+0x76/0x7e [CAUSE] Mount option "rescue=idatacsums" will completely skip loading the csum tree, so that any data read will not find any data csum thus we will ignore data checksum verification. Normally call sites utilizing csum tree will check the fs state flag NO_DATA_CSUMS bit, but unfortunately scrub does not check that bit at all. This results in scrub to call btrfs_search_slot() on a NULL pointer and triggered above crash. [FIX] Check both extent and csum tree root before doing any tree search.

📍 영향받는 시스템

Linux 커널 btrfs 파일시스템을 사용하며 rescue=idatacsums 옵션으로 마운트하고 scrub을 실행하는 시스템 (수정된 커널 버전 확인 필요)

⚔️ 공격 벡터

로컬 사용자가 rescue=idatacsums로 마운트된 btrfs에 대해 scrub을 트리거하여 커널 패닉이나 서비스 거부를 유발

🛡️ 대응 방법

배포판 제공 최신 커널로 업데이트하거나 해당 커널의 수정 커밋(csum/extent 트리 루트 검사 추가)을 적용

🔧 검증 코드

첫 번째 출력은 커널 버전이며 수정 패치 포함 여부를 배포판 보안 공지로 확인하고, 두 번째는 btrfs 지원 여부, 세 번째 값이 0보다 크면 rescue=idatacsums 옵션으로 마운트된 파일시스템이 있어 위험에 노출될 수 있음을 의미합니다.

Shell / Script
uname -r && grep -i btrfs /proc/filesystems 2>/dev/null && mount | grep btrfs | grep -c idatacsums

📊 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