CVE-2025-37931: btrfs: adjust subpage bit start based on sectorsize
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.
Security readout for executives and security teams
Plain-English summary
A Linux Btrfs bookkeeping error can skip writing dirty filesystem metadata on certain subpage configurations. This may corrupt filesystems, damage data integrity, or make systems unavailable, including through ordinary operation rather than an attack. Risk is concentrated on systems using Btrfs with page sizes larger than filesystem node or sector sizes.
Executive priority
Treat as a high-priority reliability and data-integrity issue for confirmed Btrfs subpage deployments. Expedite kernel updates on critical storage, appliance, and availability-sensitive systems. Other Linux systems should first be inventoried to determine whether Btrfs and the relevant geometry are present.
Technical view
The dirty-range scan increments a bitmap position by one sector when encountering a clean range, although extent-buffer positions are separated by sectors-per-node. Subsequent radix-tree lookups can target nonexistent entries and skip dirty extent-buffer writeout. The supplied example uses 64 KiB pages, 16 KiB nodes, and 4 KiB sectors. Stable kernel commits change the increment to sectors-per-node.
Likely exposure
Likely exposure includes affected Linux kernels using Btrfs subpage layouts, especially 64 KiB pages with smaller nodes and sectors. The supplied affected-version data is not sufficiently structured to establish precise distribution package boundaries. Systems not using Btrfs or relevant subpage configurations are less likely to be exposed.
Exploitation context
The CVSS vector describes local access, low complexity, and low privileges, with high integrity and availability impact. However, the bundle provides no evidence of active exploitation, and the CVE is not listed as KEV. Production corruption was observed during normal operation, so operational failure may be more immediate than deliberate exploitation.
Researcher notes
The defect is an offset-progression error in Btrfs subpage extent-buffer writeback. The source states that skipped dirty blocks affect metadata writes and caused tree-log corruption. Precise affected and fixed package versions require vendor confirmation because distribution backports may not align with upstream version numbers, and the bundled version list is ambiguous.
Mitigation direction
Install a vendor-supported kernel containing the applicable stable Btrfs fix.
Consult Linux distribution or appliance advisories for exact fixed package versions.
Prioritize affected systems holding critical data or requiring high availability.
Maintain verified backups before filesystem maintenance or kernel changes.
Reduce reliance on exposed Btrfs systems until remediation where operationally practical.
Validation and detection
Inventory systems using Btrfs and record their kernel versions.
Identify page, node, and sector sizes for each Btrfs deployment.
Confirm the installed kernel includes the relevant fix or vendor backport.
Review kernel and filesystem logs for Btrfs corruption or writeback errors.
After backup, use vendor-approved Btrfs integrity checks where appropriate.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-37931 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
2ADP providers
8Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.