In the Linux kernel, the following vulnerability has been resolved: btrfs: ensure no dirty metadata is written back for an fs with errors [BUG]… (CVE-2025-40303)
A high-severity vulnerability in the Linux kernel's btrfs filesystem was resolved to prevent dirty metadata from being written back when the filesystem is in an error state. The issue could cause use-after-free conditions and filesystem corruption, especially when using RAID5 or RAID6 metadata configurations. The fix prevents submission of writeback operations for dirty metadata if the filesystem is marked as errored, avoiding further corruption and crashes.
AI Analysis
Technical Summary
The vulnerability (CVE-2025-40303) in the Linux kernel's btrfs filesystem arises when the filesystem encounters an error and is marked as such, freezing metadata transactions. Dirty metadata pages remain in the page cache and are not invalidated, leading to writeback attempts after worker threads have stopped. In RAID5/6 metadata setups, this triggers read-modify-write operations queued to stopped workers, causing use-after-free errors and potential filesystem corruption. The fix adds handling in write_one_eb() to immediately fail writeback submissions if the filesystem is errored, ensuring dirty metadata is discarded rather than written back, preventing further corruption and crashes.
Potential Impact
Exploitation of this vulnerability can lead to use-after-free conditions causing kernel crashes and potential filesystem corruption, particularly in btrfs filesystems using RAID5 or RAID6 metadata configurations. The integrity and availability of the filesystem can be severely impacted.
Mitigation Recommendations
A fix has been implemented in the Linux kernel to address this vulnerability by preventing dirty metadata writeback when the filesystem is in an error state. Users should apply the official kernel updates that include this fix. Patch status is not explicitly confirmed in the provided data; therefore, check the vendor advisory for current remediation guidance.
In the Linux kernel, the following vulnerability has been resolved: btrfs: ensure no dirty metadata is written back for an fs with errors [BUG]… (CVE-2025-40303)
Description
A high-severity vulnerability in the Linux kernel's btrfs filesystem was resolved to prevent dirty metadata from being written back when the filesystem is in an error state. The issue could cause use-after-free conditions and filesystem corruption, especially when using RAID5 or RAID6 metadata configurations. The fix prevents submission of writeback operations for dirty metadata if the filesystem is marked as errored, avoiding further corruption and crashes.
CVSS v3.1
Score 7.8high
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability (CVE-2025-40303) in the Linux kernel's btrfs filesystem arises when the filesystem encounters an error and is marked as such, freezing metadata transactions. Dirty metadata pages remain in the page cache and are not invalidated, leading to writeback attempts after worker threads have stopped. In RAID5/6 metadata setups, this triggers read-modify-write operations queued to stopped workers, causing use-after-free errors and potential filesystem corruption. The fix adds handling in write_one_eb() to immediately fail writeback submissions if the filesystem is errored, ensuring dirty metadata is discarded rather than written back, preventing further corruption and crashes.
Potential Impact
Exploitation of this vulnerability can lead to use-after-free conditions causing kernel crashes and potential filesystem corruption, particularly in btrfs filesystems using RAID5 or RAID6 metadata configurations. The integrity and availability of the filesystem can be severely impacted.
Mitigation Recommendations
A fix has been implemented in the Linux kernel to address this vulnerability by preventing dirty metadata writeback when the filesystem is in an error state. Users should apply the official kernel updates that include this fix. Patch status is not explicitly confirmed in the provided data; therefore, check the vendor advisory for current remediation guidance.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-5q2h-f93q-8fv2
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2025-40303"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a6b72d49c2644c7f847951f
Added to database: 07/30/2026, 15:50:44 UTC
Last enriched: 07/30/2026, 17:51:59 UTC
Last updated: 09/10/2026, 19:38:46 UTC
Views: 10
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.