# CVE-2025-38260: btrfs: handle csum tree error with rescue=ibadroots correctly

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.27% (percentile 12, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2025-07-09T10:42:36.204Z
- **Modified:** 2026-06-17T09:16:30.037Z

## Who should check

- Anyone running Linux \>= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, \< f8ce11903211542a61f05c02caedd2edfb4256b8; \>= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, \< fc97a116dc4929905538bc0bd3af7faa51192957; \>= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, \< bbe9231fe611a54a447962494472f604419bad59; \>= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, \< 3f5c4a996f8f4fecd24a3eb344a307c50af895c2; \>= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, \< 547e836661554dcfa15c212a3821664e85b4191a
- Anyone running Linux 5.17

## Description

In the Linux kernel, the following vulnerability has been resolved:

btrfs: handle csum tree error with rescue=ibadroots correctly

\[BUG\]
There is syzbot based reproducer that can crash the kernel, with the
following call trace: (With some debug output added)

 DEBUG: rescue=ibadroots parsed
 BTRFS: device fsid 14d642db-7b15-43e4-81e6-4b8fac6a25f8 devid 1 transid 8 /dev/loop0 (7:0) scanned by repro (1010)
 BTRFS info (device loop0): first mount of filesystem 14d642db-7b15-43e4-81e6-4b8fac6a25f8
 BTRFS info (device loop0): using blake2b (blake2b-256-generic) checksum algorithm
 BTRFS info (device loop0): using free-space-tree
 BTRFS warning (device loop0): checksum verify failed on logical 5312512 mirror 1 wanted 0xb043382657aede36608fd3386d6b001692ff406164733d94e2d9a180412c6003 found 0x810ceb2bacb7f0f9eb2bf3b2b15c02af867cb35ad450898169f3b1f0bd818651 level 0
 DEBUG: read tree root path failed for tree csum, ret=-5
 BTRFS warning (device loop0): checksum verify failed on logical 5328896 mirror 1 wanted 0x51be4e8b303da58e6340226815b70e3a93592dac3f30dd510c7517454de8567a found 0x51be4e8b303da58e634022a315b70e3a93592dac3f30dd510c7517454de8567a level 0
 BTRFS warning (device loop0): checksum verify failed on logical 5292032 mirror 1 wanted 0x1924ccd683be9efc2fa98582ef58760e3848e9043db8649ee382681e220cdee4 found 0x0cb6184f6e8799d9f8cb335dccd1d1832da1071d12290dab3b85b587ecacca6e level 0
 process 'repro' launched './file2' with NULL argv: empty string added
 DEBUG: no csum root, idatacsums=0 ibadroots=134217728
 Oops: general protection fault, probably for non-canonical address 0xdffffc0000000041: 0000 \[\#1\] SMP KASAN NOPTI
 KASAN: null-ptr-deref in range \[0x0000000000000208-0x000000000000020f\]
 CPU: 5 UID: 0 PID: 1010 Comm: repro Tainted: G           OE       6.15.0-custom+ \#249 PREEMPT(full)
 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS unknown 02/02/2022
 RIP: 0010:btrfs\_lookup\_csum+0x93/0x3d0 \[btrfs\]
 Call Trace:
  \<TASK\>
  btrfs\_lookup\_bio\_sums+0x47a/0xdf0 \[btrfs\]
  btrfs\_submit\_bbio+0x43e/0x1a80 \[btrfs\]
  submit\_one\_bio+0xde/0x160 \[btrfs\]
  btrfs\_readahead+0x498/0x6a0 \[btrfs\]
  read\_pages+0x1c3/0xb20
  page\_cache\_ra\_order+0x4b5/0xc20
  filemap\_get\_pages+0x2d3/0x19e0
  filemap\_read+0x314/0xde0
  \_\_kernel\_read+0x35b/0x900
  bprm\_execve+0x62e/0x1140
  do\_execveat\_common.isra.0+0x3fc/0x520
  \_\_x64\_sys\_execveat+0xdc/0x130
  do\_syscall\_64+0x54/0x1d0
  entry\_SYSCALL\_64\_after\_hwframe+0x76/0x7e
 ---\[ end trace 0000000000000000 \]---

\[CAUSE\]
Firstly the fs has a corrupted csum tree root, thus to mount the fs we
have to go "ro,rescue=ibadroots" mount option.

Normally with that mount option, a bad csum tree root should set
BTRFS\_FS\_STATE\_NO\_DATA\_CSUMS flag, so that any future data read will
ignore csum search.

But in this particular case, we have the following call trace that
caused NULL csum root, but not setting BTRFS\_FS\_STATE\_NO\_DATA\_CSUMS:

load\_global\_roots\_objectid():

		ret = btrfs\_search\_slot();
		/\* Succeeded \*/
		btrfs\_item\_key\_to\_cpu()
		found = true;
		/\* We found the root item for csum tree. \*/
		root = read\_tree\_root\_path();
		if (IS\_ERR(root)) {
			if (!btrfs\_test\_opt(fs\_info, IGNOREBADROOTS))
			/\*
			 \* Since we have rescue=ibadroots mount option,
			 \* @ret is still 0.
			 \*/
			break;
	if (!found \|\| ret) {
		/\* @found is true, @ret is 0, error handling for csum
		 \* tree is skipped.
		 \*/
	}

This means we completely skipped to set BTRFS\_FS\_STATE\_NO\_DATA\_CSUMS if
the csum tree is corrupted, which results unexpected later csum lookup.

\[FIX\]
If read\_tree\_root\_path() failed, always populate @ret to the error
number.

As at the end of the function, we need @ret to determine if we need to
do the extra error handling for csum tree.

## Affected and fixed versions

- Linux: \>= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, \< f8ce11903211542a61f05c02caedd2edfb4256b8; \>= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, \< fc97a116dc4929905538bc0bd3af7faa51192957; \>= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, \< bbe9231fe611a54a447962494472f604419bad59; \>= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, \< 3f5c4a996f8f4fecd24a3eb344a307c50af895c2; \>= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, \< 547e836661554dcfa15c212a3821664e85b4191a (cvelist)
- Linux: 5.17 (cvelist)

## Mitigation

- Upgrade Linux to 547e836661554dcfa15c212a3821664e85b4191a or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-38260. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-38260.md
Affected: Linux >= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, < f8ce11903211542a61f05c02caedd2edfb4256b8; >= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, < fc97a116dc4929905538bc0bd3af7faa51192957; >= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, < bbe9231fe611a54a447962494472f604419bad59; >= abed4aaae4f71a7bcdbe90a…
Fixed in: Linux 3f5c4a996f8f4fecd24a3eb344a307c50af895c2, Linux 547e836661554dcfa15c212a3821664e85b4191a

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-38260 being exploited?

There is no confirmed exploitation: CVE-2025-38260 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.27% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-38260?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-38260?

Linux \>= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, \< f8ce11903211542a61f05c02caedd2edfb4256b8; \>= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, \< fc97a116dc4929905538bc0bd3af7faa51192957; \>= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, \< bbe9231fe611a54a447962494472f604419bad59; \>= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, \< 3f5c4a996f8f4fecd24a3eb344a307c50af895c2; \>= abed4aaae4f71a7bcdbe90a65319b6e772a2689d, \< 547e836661554dcfa15c212a3821664e85b4191a; Linux 5.17.

### Is there a fix for CVE-2025-38260?

Yes. Fixed in Linux 3f5c4a996f8f4fecd24a3eb344a307c50af895c2, Linux 547e836661554dcfa15c212a3821664e85b4191a. Upgrade Linux to 547e836661554dcfa15c212a3821664e85b4191a or later.

### How do I check if I'm affected by CVE-2025-38260?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/f8ce11903211542a61f05c02caedd2edfb4256b8>
- patch: <https://git.kernel.org/stable/c/fc97a116dc4929905538bc0bd3af7faa51192957>
- patch: <https://git.kernel.org/stable/c/bbe9231fe611a54a447962494472f604419bad59>
- patch: <https://git.kernel.org/stable/c/3f5c4a996f8f4fecd24a3eb344a307c50af895c2>
- patch: <https://git.kernel.org/stable/c/547e836661554dcfa15c212a3821664e85b4191a>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-38260>

HTML: <https://flawdb.com/CVE-2025-38260> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-38260>
