CVE-2025-38059 Information
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:
[CAUSE] Mount option escue=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.
Reference
https://git.kernel.org/stable/c/50d0de59f66cbe6d597481e099bf1c70fd07e0a9 https://git.kernel.org/stable/c/6e9770de024964b1017f99ee94f71967bd6edaeb https://git.kernel.org/stable/c/d35bed14b0bc95c6845863a3744ecd10b888c830 https://git.kernel.org/stable/c/f95d186255b319c48a365d47b69bd997fecb674e
Related CNNVD
CNNVD-202506-2194 (Published: 2025-06-18)
Share on: