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
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 6.1.151, 6.12.28, 6.14.6, 6.6.105
- CVEs
- CVE-2025-37931
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 6 Nov 2026, 00:36 UTC · Revision 1
Source evidence
btrfs: adjust subpage bit start based on sectorsize
core-osv · Original sourcePublished 20 May 2025, 15:21 UTC
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
osv:CVE-2025-37931
Kernel
Fixed versions: 6.1.151, 6.6.105, 6.12.28, 6.14.6
Complete source record
{
"id": "84980b0378b5d393519e44c6aa48f3e807fdc8093a06a5c4e06256197cf3c040",
"url": "https://osv.dev/vulnerability/CVE-2025-37931",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "btrfs: adjust subpage bit start based on sectorsize",
"summary": "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 ",
"evidence": "osv:CVE-2025-37931",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.1.151",
"evidence": "/affected/1/ranges"
},
{
"value": "6.6.105",
"evidence": "/affected/1/ranges"
},
{
"value": "6.12.28",
"evidence": "/affected/1/ranges"
},
{
"value": "6.14.6",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "high",
"structured": {
"id": "CVE-2025-37931",
"aliases": [
"CVE-2025-37931"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "c4aec299fa8f73f0fd10bc556f936f0da50e3e83"
},
{
"fixed": "5111b148360f50cac9abbae8fca44cc0ac4bf9bf"
},
{
"fixed": "977849e8acd2466ac3cb49e04a3ecc73837f6b90"
},
{
"fixed": "b80db09b614cb7edec5bada1bc7c7b0eb3b453ea"
},
{
"fixed": "396f4002710030ea1cfd4c789ebaf0a6969ab34f"
},
{
"fixed": "e08e49d986f82c30f42ad0ed43ebbede1e1e3739"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-37931.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.13.0"
},
{
"fixed": "6.1.151"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.2.0"
},
{
"fixed": "6.6.105"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.7.0"
},
{
"fixed": "6.12.28"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.13.0"
},
{
"fixed": "6.14.6"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-37931.json"
}
}
],
"modified": "2026-10-28T02:30:45.579328936Z",
"provider": "osv",
"references": [
"https://cert-portal.siemens.com/productcert/html/ssa-032379.html",
"https://git.kernel.org/stable/c/396f4002710030ea1cfd4c789ebaf0a6969ab34f",
"https://git.kernel.org/stable/c/5111b148360f50cac9abbae8fca44cc0ac4bf9bf",
"https://git.kernel.org/stable/c/977849e8acd2466ac3cb49e04a3ecc73837f6b90",
"https://git.kernel.org/stable/c/b80db09b614cb7edec5bada1bc7c7b0eb3b453ea",
"https://git.kernel.org/stable/c/e08e49d986f82c30f42ad0ed43ebbede1e1e3739",
"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/37xxx/CVE-2025-37931.json",
"https://nvd.nist.gov/vuln/detail/CVE-2025-37931",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/37xxx/CVE-2025-37931.json"
}
},
"related_cves": [
{
"value": "CVE-2025-37931",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 513538,
"published_at": "2025-05-20T15:21:56.627+00:00"
}