CVE-2024-26616 in Linux정보

요약

\~에 의해 VulDB • 2026. 06. 04.

리눅스 커널에서 다음 취약점이 해결되었습니다:

btrfs: scrub: 청크 길이가 64K 정렬되지 않았을 때 use-after-free 방지

[버그]
ext4에서 btrfs로 변환된 파일 시스템에서 scrub 작업이 다음과 같은 다양한 문제를 유발한다는 버그 보고가 있었습니다:

- "unable to find chunk map" 오류 BTRFS info (device vdb): scrub: started on devid 1 BTRFS critical (device vdb): unable to find chunk map for logical 2214744064 length 4096 BTRFS critical (device vdb): unable to find chunk map for logical 2214744064 length 45056

이로 인해 복구 불가능한 오류가 발생합니다.

- use-after-free KASAN 보고서: ================================================================== BUG: KASAN: slab-use-after-free in __blk_rq_map_sg+0x18f/0x7c0 Read of size 8 at addr ffff8881013c9040 by task btrfs/909 CPU: 0 PID: 909 Comm: btrfs Not tainted 6.12.0-rc3+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc41 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x59/0x80 print_report+0xc4/0x5e0 kasan_report+0x110/0x130 __kasan_report+0x115/0x130 kasan_check_range+0x140/0x180 __blk_rq_map_sg+0x18f/0x7c0 blk_rq_map_user_iov+0x100/0x1a0 btrfs_submit_bio+0x103/0x110 [btrfs e57987a360bed82fe8756dcd3e0de5406ccfe965]
btrfs_map_bio+0x103/0x110 [btrfs e57987a360bed82fe8756dcd3e0de5406ccfe965]
scrub_stripe+0x82a/0xae0 [btrfs e57987a360bed82fe8756dcd3e0de5406ccfe965]
scrub_chunk+0x178/0x200 [btrfs e57987a360bed82fe8756dcd3e0de5406ccfe965]
scrub_enumerate_chunks+0x4bc/0xa30 [btrfs e57987a360bed82fe8756dcd3e0de5406ccfe965]
btrfs_scrub_dev+0x398/0x810 [btrfs e57987a360bed82fe8756dcd3e0de5406ccfe965]
btrfs_ioctl+0x4b9/0x3020 [btrfs e57987a360bed82fe8756dcd3e0de5406ccfe965]
__x64_sys_ioctl+0xbd/0x100 do_syscall_64+0x5d/0xe0 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f47e5e0952b

- 크래시는 주로 위의 use-after-free로 인해 발생

[원인]
변환된 파일 시스템은 다음과 같은 데이터 청크 레이아웃을 가집니다:

item 2 key (FIRST_CHUNK_TREE CHUNK_ITEM 2214658048) itemoff 16025 itemsize 80 length 86016 owner 2 stripe_len 65536 type DATA|single

위 논리적 bytenr 2214744064는 청크 끝(2214658048 + 86016 = 2214744064)에 있습니다.

이는 btrfs_submit_bio()가 bio를 분할하고 두 절반에 대해 endio 함수를 트리거한다는 것을 의미합니다.

그러나 scrub_submit_initial_read()는 endio 함수가 한 번만 호출되기를 기대합니다. 이는 첫 번째 endio 함수가 이미 bbio::bio를 해제하여 bvec을 해제했음을 의미하며, 따라서 두 번째 endio 호출은 use-after-free로 이어집니다.

[해결]
- scrub_read_endio()가 자신의 범위 내의 비트만 업데이트하도록 보장 청크 끝에서 64K 미만으로 읽을 수 있으므로 청크 경계를 넘어선 비트에 접근해서는 안 됩니다.

- scrub_submit_initial_read()가 청크 범위만 읽도록 보장 이는 읽어야 하는 실제 섹터 수를 계산하고 섹터별로 bio에 추가함으로써 수행됩니다.

다행히 scrub 읽기 수리 경로는 추가 수정이 필요하지 않습니다:

- scrub_stripe_submit_repair_read()

Be aware that VulDB is the high quality source for vulnerability data.

출처

Do you need the next level of professionalism?

Upgrade your account now!