# CVE-2025-37931: btrfs: adjust subpage bit start based on sectorsize

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

- **Severity:** HIGH 7.3
- **CVSS:** 7.3 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: Low; Integrity impact: High; 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.30% (percentile 15, 2026-11-28)
- **Published:** 2025-05-20T15:21:56.627Z
- **Modified:** 2026-08-05T11:58:27.222Z

## Who should check

- Anyone running Linux \>= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, \< 5111b148360f50cac9abbae8fca44cc0ac4bf9bf; \>= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, \< 977849e8acd2466ac3cb49e04a3ecc73837f6b90; \>= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, \< b80db09b614cb7edec5bada1bc7c7b0eb3b453ea; \>= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, \< 396f4002710030ea1cfd4c789ebaf0a6969ab34f; \>= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, \< e08e49d986f82c30f42ad0ed43ebbede1e1e3739
- Anyone running Linux 5.13

## Description

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

btrfs: adjust subpage bit start based on sectorsize

When running machines with 64k page size and a 16k nodesize we started
seeing tree log corruption in production.  This turned out to be because
we were not writing out dirty blocks sometimes, so this in fact affects
all metadata writes.

When writing out a subpage EB we scan the subpage bitmap for a dirty
range.  If the range isn't dirty we do

	bit\_start++;

to move onto the next bit.  The problem is the bitmap is based on the
number of sectors that an EB has.  So in this case, we have a 64k
pagesize, 16k nodesize, but a 4k sectorsize.  This means our bitmap is 4
bits for every node.  With a 64k page size we end up with 4 nodes per
page.

To make this easier this is how everything looks

\[0         16k       32k       48k     \] logical address
\[0         4         8         12      \] radix tree offset
\[               64k page               \] folio
\[ 16k eb \]\[ 16k eb \]\[ 16k eb \]\[ 16k eb \] extent buffers
\[ \| \| \| \|  \| \| \| \|   \| \| \| \|   \| \| \| \| \] bitmap

Now we use all of our addressing based on fs\_info-\>sectorsize\_bits, so
as you can see the above our 16k eb-\>start turns into radix entry 4.

When we find a dirty range for our eb, we correctly do bit\_start +=
sectors\_per\_node, because if we start at bit 0, the next bit for the
next eb is 4, to correspond to eb-\>start 16k.

However if our range is clean, we will do bit\_start++, which will now
put us offset from our radix tree entries.

In our case, assume that the first time we check the bitmap the block is
not dirty, we increment bit\_start so now it == 1, and then we loop
around and check again.  This time it is dirty, and we go to find that
start using the following equation

	start = folio\_start + bit\_start \* fs\_info-\>sectorsize;

so in the case above, eb-\>start 0 is now dirty, and we calculate start
as

	0 + 1 \* fs\_info-\>sectorsize = 4096
	4096 \>\> 12 = 1

Now we're looking up the radix tree for 1, and we won't find an eb.
What's worse is now we're using bit\_start == 1, so we do bit\_start +=
sectors\_per\_node, which is now 5.  If that eb is dirty we will run into
the same thing, we will look at an offset that is not populated in the
radix tree, and now we're skipping the writeout of dirty extent buffers.

The best fix for this is to not use sectorsize\_bits to address nodes,
but that's a larger change.  Since this is a fs corruption problem fix
it simply by always using sectors\_per\_node to increment the start bit.

## Affected and fixed versions

- Linux: \>= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, \< 5111b148360f50cac9abbae8fca44cc0ac4bf9bf; \>= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, \< 977849e8acd2466ac3cb49e04a3ecc73837f6b90; \>= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, \< b80db09b614cb7edec5bada1bc7c7b0eb3b453ea; \>= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, \< 396f4002710030ea1cfd4c789ebaf0a6969ab34f; \>= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, \< e08e49d986f82c30f42ad0ed43ebbede1e1e3739 (cvelist)
- Linux: 5.13 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-37931.md
Affected: Linux >= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, < 5111b148360f50cac9abbae8fca44cc0ac4bf9bf; >= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, < 977849e8acd2466ac3cb49e04a3ecc73837f6b90; >= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, < b80db09b614cb7edec5bada1bc7c7b0eb3b453ea; >= c4aec299fa8f73f0fd10bc5…
Fixed in: Linux 5111b148360f50cac9abbae8fca44cc0ac4bf9bf, Linux 977849e8acd2466ac3cb49e04a3ecc73837f6b90, Linux 396f4002710030ea1cfd4c789ebaf0a6969ab34f

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-37931 being exploited?

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

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

High: CVSS 7.3 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, \< 5111b148360f50cac9abbae8fca44cc0ac4bf9bf; \>= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, \< 977849e8acd2466ac3cb49e04a3ecc73837f6b90; \>= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, \< b80db09b614cb7edec5bada1bc7c7b0eb3b453ea; \>= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, \< 396f4002710030ea1cfd4c789ebaf0a6969ab34f; \>= c4aec299fa8f73f0fd10bc556f936f0da50e3e83, \< e08e49d986f82c30f42ad0ed43ebbede1e1e3739; Linux 5.13.

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

Yes. Fixed in Linux 5111b148360f50cac9abbae8fca44cc0ac4bf9bf, Linux 977849e8acd2466ac3cb49e04a3ecc73837f6b90, Linux 396f4002710030ea1cfd4c789ebaf0a6969ab34f. No fix listed yet: follow the vendor advisory.

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

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/5111b148360f50cac9abbae8fca44cc0ac4bf9bf>
- patch: <https://git.kernel.org/stable/c/977849e8acd2466ac3cb49e04a3ecc73837f6b90>
- patch: <https://git.kernel.org/stable/c/b80db09b614cb7edec5bada1bc7c7b0eb3b453ea>
- patch: <https://git.kernel.org/stable/c/396f4002710030ea1cfd4c789ebaf0a6969ab34f>
- patch: <https://git.kernel.org/stable/c/e08e49d986f82c30f42ad0ed43ebbede1e1e3739>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-032379.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-37931>

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