We use these services and cookies to improve your user experience. You may opt out if you wish, however, this may limit some features on this site.

Please see our statement on Data Privacy.

Crisp.chat (Helpdesk and Chat)

Ok

THREATINT
PUBLISHED

CVE-2025-38059

btrfs: avoid NULL pointer dereference if no valid csum tree



Description

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.

Reserved 2025-04-16 | Published 2025-06-18 | Updated 2025-06-18 | Assigner Linux

Product status

Default status
unaffected

1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before 50d0de59f66cbe6d597481e099bf1c70fd07e0a9
affected

1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before 6e9770de024964b1017f99ee94f71967bd6edaeb
affected

1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before d35bed14b0bc95c6845863a3744ecd10b888c830
affected

1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before f95d186255b319c48a365d47b69bd997fecb674e
affected

Default status
affected

6.6.93
unaffected

6.12.31
unaffected

6.14.9
unaffected

6.15
unaffected

References

git.kernel.org/...c/50d0de59f66cbe6d597481e099bf1c70fd07e0a9

git.kernel.org/...c/6e9770de024964b1017f99ee94f71967bd6edaeb

git.kernel.org/...c/d35bed14b0bc95c6845863a3744ecd10b888c830

git.kernel.org/...c/f95d186255b319c48a365d47b69bd997fecb674e

cve.org (CVE-2025-38059)

nvd.nist.gov (CVE-2025-38059)

Download JSON

Share this page
https://cve.threatint.eu/CVE/CVE-2025-38059

Support options

Helpdesk Chat, Email, Knowledgebase