CVE-2024-35798: btrfs: fix race in read_extent_buffer_pages()
In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix race in read_extent_buffer_pages()
There are reports from tree-checker that detects corrupted nodes,
without any obvious pattern so possibly an overwrite in memory.
After some debugging it turns out there's a race when reading an extent
buffer the uptodate status can be missed.
To prevent concurrent reads for the same extent buffer,
read_extent_buffer_pages() performs these checks:
/* (1) */
if (test_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags))
return 0;
/* (2) */
if (test_and_set_bit(EXTENT_BUFFER_READING, &eb->bflags))
goto done;
At this point, it seems safe to start the actual read operation. Once
that completes, end_bbio_meta_read() does
/* (3) */
set_extent_buffer_uptodate(eb);
/* (4) */
clear_bit(EXTENT_BUFFER_READING, &eb->bflags);
Normally, this is enough to ensure only one read happens, and all other
callers wait for it to finish before returning. Unfortunately, there is
a racey interleaving:
Thread A | Thread B | Thread C
---------+----------+---------
(1) | |
| (1) |
(2) | |
(3) | |
(4) | |
| (2) |
| | (1)
When this happens, thread B kicks of an unnecessary read. Worse, thread
C will see UPTODATE set and return immediately, while the read from
thread B is still in progress. This race could result in tree-checker
errors like this as the extent buffer is concurrently modified:
BTRFS critical (device dm-0): corrupted node, root=256
block=8550954455682405139 owner mismatch, have 11858205567642294356
expect [256, 18446744073709551360]
Fix it by testing UPTODATE again after setting the READING bit, and if
it's been set, skip the unnecessary read.
[ minor update of changelog ]
Security readout for executives and security teams
Plain-English summary
A race condition in the Linux kernel’s Btrfs filesystem can let one task use filesystem metadata while another read is still modifying it. This may produce corrupted-node warnings and could affect system confidentiality, integrity, and availability. The supplied CVSS score is 7.8, but the evidence does not establish practical exploitation.
Executive priority
Prioritize remediation on critical Btrfs systems, especially multi-user or untrusted-workload hosts. Treat reported corruption as an operational incident requiring investigation and backup verification. This deserves timely patching, although the supplied sources do not support emergency internet-wide action or claims of active exploitation.
Technical view
The flaw is in read_extent_buffer_pages(). A concurrent caller can observe EXTENT_BUFFER_UPTODATE before an unnecessary second read finishes, allowing access to a concurrently modified extent buffer. The kernel fix rechecks UPTODATE after acquiring the READING bit and skips the redundant read when appropriate.
Likely exposure
Exposure is limited to systems running affected Linux kernel versions with Btrfs in use. The bundle identifies versions 6.5, 6.6.24, 6.7.12, 6.8.3, and 6.9 as affected, but distribution backports may change exposure. Inventory actual vendor kernel builds and patch status.
Exploitation context
The supplied vector describes local, low-privilege access with no user interaction. The bundle reports corrupted filesystem nodes and possible memory overwrite, but provides no confirmed exploit, attack campaign, or demonstrated security impact. This CVE is not listed as KEV in the supplied evidence.
Researcher notes
The security record describes a synchronization error involving UPTODATE and READING state transitions. Four stable-kernel commits are supplied, indicating branch-specific backports. No CWE is assigned. The duplicated commit identifiers and unusual affected-version presentation make vendor advisory mapping preferable to version-string assumptions.
Mitigation direction
Install a vendor-supported kernel containing the applicable upstream stable fix.
Check distribution advisories because vendors may backport fixes without changing the upstream version.
Prioritize Btrfs hosts processing untrusted local workloads or supporting critical data.
Maintain verified backups before kernel or filesystem maintenance.
Validation and detection
Identify hosts using Btrfs and record their exact kernel package versions.
Map each vendor kernel build to its advisory or included stable fix commit.
Review kernel logs for Btrfs tree-checker or corrupted-node errors.
Confirm updated hosts booted into the remediated kernel.
Recheck exposed hosts after patching and document any deferred systems.
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-2024-35798 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.
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.