CVE-2025-40303 — btrfs: ensure no dirty metadata is written back for an fs with errors
In the Linux kernel, the following vulnerability has been resolved: btrfs: ensure no dirty metadata is written back for an fs with errors [BUG] During development of a minor feature (make sure all btrfs_bio::end_io() is called in task context), I noticed a crash in generic/388, where metadata writes triggered new works after btrfs_stop_all_workers(). It turns out that it can even happen without any code modification, just using RAID5 for metadata and the same workload from generic/388 is going to trigger the use-after-free. [CAUSE] If btrfs hits an error, the fs is marked as error, no new transaction is allowed thus metadata is in a frozen state. But there are some metadata modifications before that error, and they are still in the btree inode page cache. Since there will be no real transaction commit, all those dirty folios are just kept as is in the page cache, and they can not be invalidated by invalidate_inode_pages2() call inside close_ctree(), because they are dirty. And finally after btrfs_stop_all_workers(), we call iput() on btree inode, which triggers writeback of those dirty metadata. And if the fs is using RAID56 metadata, this will trigger RMW and queue new works into rmw_workers, which is already stopped, causing warning from queue_work() and use-after-free. [FIX] Add a special handling for write_one_eb(), that if the fs is already in an error state, immediately mark the bbio as failure, instead of really submitting them. Then during close_ctree(), iput() will just discard all those dirty tree blocks without really writing them back, thus no more new jobs for already stopped-and-freed workqueues. The extra discard in write_one_eb() also acts as an extra safenet. E.g. the transaction abort is triggered by some extent/free space tree corruptions, and since extent/free space tree is already corrupted some tree blocks may be allocated where they shouldn't be (overwriting existing tree blocks). In that case writing them back will further corrupting the fs.
Who exploits it and how urgent it is
A 0–100 score combining confirmed exploitation, ransomware and APT use, public exploits, EPSS and severity.
How the score was calculated
- EPSS 0.1% (30-day exploitation probability)+0
- Technical severity (high)+6
The score orders the patch queue; it does not replace your asset context (internet exposure, criticality, compensating controls).
Triage
Is it exploited, how likely is exploitation, what does it touch, and how severe do the sources call it.
Remediation
Fixes and mitigations documented by the sources — linked to the original advisory.
No fix documented by the sources we poll. That does not mean none exists: check the vendor advisory.
First 24 hours
Ordered from the record’s own fields — exposure first, because you cannot patch what you have not found. A rule-generated starting point.
- Identify exposed assets running the affected vendor/product/version combinations (Linux Linux).
- No fix documented in the sources: reduce exposure and monitor the vendor advisory.
- Search available logs for exploit probes, errors and authentication anomalies.
Affected scope
Vendor, product and versions as the sources word them.
| Vendor | Product | Versions | Status | Source |
|---|---|---|---|---|
| Linux | Linux | ≥ 13e6c37b989859e70b0d73d3f2cb0aa022159b17 and < 066ee13f05fbd82ada01883e51f0695172f98dff≥ 13e6c37b989859e70b0d73d3f2cb0aa022159b17 and < e2b3859067bf012d53c49b3f885fef40624a2c83≥ 13e6c37b989859e70b0d73d3f2cb0aa022159b17 and < 54a5b5a15588e3b0b294df31474d08a2678d4291≥ 13e6c37b989859e70b0d73d3f2cb0aa022159b17 and < 2618849f31e7cf51fadd4a5242458501a6d5b315version 3.10 | Vulnerable | CVE Program (cve.org) e CISA ADP |
Attack characteristics
The CVSS vector, decoded. It describes the attack, not your exposure to it.
Every base score collected
Sources score independently and may disagree; each row says who scored it and under which version.
| Score | Version | Severity | Expl. | Impact | Scored by |
|---|---|---|---|---|---|
| 7.8 | CVSS 3.1 | High | 1.8 | 5.9 | 416baaa9-dc9f-4396-8d5f-8c081fb06d67 via NIST National Vulnerability Database |
| 7.8 | CVSS 3.1 | High | — | — | GitHub, Inc. via GitHub Security Advisories |
| 7.8 | CVSS 3.1 | High | — | — | Linux via CVE Program (cve.org) e CISA ADP |
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (score shown at the top: 416baaa9-dc9f-4396-8d5f-8c081fb06d67) EPSS over time FIRST
Oct 13, 2026 → Oct 14, 2026 · 2 reading(s) · max 0.14%
Detection
Read off the CVSS vector and the weakness class. Starting points, not tested rules.
- Local/physical vector: focus on endpoint telemetry (EDR) from affected hosts.
Timeline
What happened to this CVE, newest first.
- 2026
- Affected products added · linux/linux
- Record published
- CVSS changed · 7.8
- Source status changed · → Deferred
- Record created in this database
- 2025
- CVE published
Source activity
Repeated readings are counted rather than listed.
- 1× References added · Oct 14, 2026 – Oct 14, 2026
- 1× Official description updated · Oct 13, 2026 – Oct 13, 2026
References
6 on the record
- git.kernel.org/stable/c/54a5b5a15588e3b0b294df31474d08a2678d4291
- nvd.nist.gov/vuln/detail/CVE-2025-40303
- git.kernel.org/stable/c/e2b3859067bf012d53c49b3f885fef40624a2c83
- git.kernel.org/stable/c/2618849f31e7cf51fadd4a5242458501a6d5b315
- github.com/advisories/GHSA-5q2h-f93q-8fv2
- git.kernel.org/stable/c/066ee13f05fbd82ada01883e51f0695172f98dff
Elsewhere on this site
Related CVEs (same products)
- Critical CVE-2026-99999 ipv4: validate checksum_start before completing checksum 9h
- Unknown CVE-2026-98432 ipv4: free inet_opt and ireq_opt after an RCU grace period 9h
- Unknown CVE-2026-98431 RDMA/uverbs: Fix mmap_lock/disassociation_lock circular dependency 1d
- Unknown CVE-2026-98430 RDMA/efa: Keep admin queues alive while IRQ is registered 1d
- Unknown CVE-2026-98429 RDMA/efa: Keep EQ resources alive while IRQ is registered 1d
- Unknown CVE-2026-98428 ALSA: usb: 6fire: Avoid embedded URBs 1d
Not in any source we poll
Listed rather than left blank: an empty field and an unmeasured one look identical on screen, and only one is a reason to look elsewhere.
- No fixed version, patch or mitigation documented.
- No CISA SSVC assessment.
- No CWE classification.
- No confirmed IOCs, IP addresses, domains, file hashes, or malware artifacts supplied.
- No organization-specific asset inventory, compensating-control status, or patch deployment evidence supplied.
- No exploit packet captures, log samples, or incident case IDs supplied.
Answered from this record
Text assembled only from the fields above — no additional claims.
What should defenders know first?
CVE-2025-40303 is "btrfs: ensure no dirty metadata is written back for an fs with errors", rated High. It affects Linux (Linux); versions are in the scope table. It is not in CISA KEV, which does not rule out exploitation. CVSS 7.8 describes technical severity. EPSS 0.14% estimates the probability of exploitation in 30 days; neither replaces your asset context. First verify whether exposed or business-critical assets run the affected versions, apply vendor fixes or mitigations, and preserve logs for review.
Comments
Moderated technical discussion. Read the community guidelines.
No comments yet.
Sign in or create an account to comment and suggest corrections.