Skip to main content

Linux Kernel CVE-2025-40303

| EUVDEUVD-2025-201642 HIGH
2025-12-08 416baaa9-dc9f-4396-8d5f-8c081fb06d67
High
Disputed · 7.8 Vendor: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Share

Severity by source

Sources disagree (Low–High)
Vendor (416baaa9-dc9f-4396-8d5f-8c081fb06d67) PRIMARY
7.8 HIGH
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
vuln.today AI
5.3 MEDIUM

Local low-priv trigger, but requires a prior fs-error state and non-default RAID56 metadata (AC:H); impact is primarily a kernel crash (A:H) with limited integrity, no confidentiality loss.

3.1 AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H
4.0 AV:L/AC:H/AT:P/PR:L/UI:N/VC:N/VI:L/VA:H/SC:N/SI:N/SA:N
SUSE
5.3 MEDIUM
AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H
Red Hat
3.3 LOW
qualitative

vuln.today treats the vendor’s rating as authoritative. A higher third-party CVSS (e.g. CISA-ADP) is shown for transparency but does not drive the headline severity.

CVSS VectorVendor: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

6
CVSS changed
Jul 30, 2026 - 06:37 NVD
7.8 (HIGH)
Patch released
Mar 16, 2026 - 15:00 nvd
Patch available
EUVD ID Assigned
Mar 15, 2026 - 17:54 euvd
EUVD-2025-201642
Analysis Generated
Mar 15, 2026 - 17:54 vuln.today
CVE Published
Dec 08, 2025 - 01:16 cve.org
HIGH 7.8
CVE Published
Dec 08, 2025 - 01:16 nvd
N/A

DescriptionCVE.org

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.

AnalysisAI

Use-after-free in the Linux kernel btrfs filesystem allows a local user to crash the system during unmount of an error-flagged filesystem, particularly when RAID56 is used for metadata. When btrfs marks a filesystem as errored, dirty tree-block folios linger in the btree inode page cache and are written back during close_ctree() after the worker threads have already been stopped and freed, causing queue_work() on a destroyed rmw_workers queue and a use-after-free. CVSS is 7.8 (High); this is a local privilege/DoS issue with no public exploit identified at time of analysis and a very low EPSS of 0.03%.

Technical ContextAI

The flaw lives in the btrfs copy-on-write filesystem's metadata writeback path within the Linux kernel. After an error transitions the fs to a frozen error state, no transaction commits, so dirty metadata folios in the btree inode's page cache cannot be invalidated by invalidate_inode_pages2() during close_ctree(). The final iput() on the btree inode triggers writeback of these dirty extent buffers; with RAID56 metadata this initiates a read-modify-write cycle that queues jobs onto rmw_workers after btrfs_stop_all_workers() has already torn down and freed that workqueue - a classic use-after-free (CWE-416 class, though CWE is listed N/A in the input). The fix modifies write_one_eb() to immediately mark the bbio as failed when the fs is already in an error state, so the dirty tree blocks are discarded rather than submitted, which also prevents further on-disk corruption when the abort stems from extent/free-space tree corruption.

RemediationAI

Vendor-released patch: upgrade to a fixed Linux kernel - 6.6.117, 6.12.58, 6.17.8, or 6.18 (or later within each series), sourced from the stable commits at https://git.kernel.org/stable/c/e2b3859067bf012d53c49b3f885fef40624a2c83 and its siblings. Distribution users should apply their vendor kernel update, e.g. Ubuntu per USN-8095-1 (https://ubuntu.com/security/notices/USN-8095-1), and reboot into the patched kernel. If immediate patching is not possible, a targeted compensating control is to avoid using RAID56 profiles for btrfs metadata (use RAID1/RAID1C3 for metadata instead), which removes the RMW path that most reliably triggers the use-after-free; the trade-off is a metadata-profile conversion (btrfs balance) and reduced RAID56-style space efficiency for metadata. As general hardening, restrict local/administrative access needed to mount and stress btrfs filesystems, since exploitation requires local privileges.

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
Container suse/sl-micro/6.0/baremetal-os-container:latest Container suse/sl-micro/6.0/base-os-container:latest Container suse/sl-micro/6.0/kvm-os-container:latest Container suse/sl-micro/6.0/rt-os-container:latest Image SL-Micro Affected
Container suse/sl-micro/6.0/toolbox:latest Affected
Image SLES-Azure-3P Image SLES-Azure-Basic Image SLES-Azure-Standard Image SLES-BYOS-Azure Image SLES-BYOS-EC2 Image SLES-BYOS-GCE Image SLES-CHOST-BYOS-Aliyun Image SLES-CHOST-BYOS-Azure Image SLES-CHOST-BYOS-EC2 Image SLES-CHOST-BYOS-GCE Image SLES-CHOST-BYOS-GDC Image SLES-CHOST-BYOS-SAP-CCloud Image SLES-EC2 Image SLES-EC2-ECS Image SLES-GCE Image SLES-GCE-3P Image SLES-Hardened-BYOS-Azure Image SLES-Hardened-BYOS-EC2 Image SLES-Hardened-BYOS-GCE Image SLES-SAPCAL-Azure Image SLES-SAPCAL-EC2 Image SLES-SAPCAL-GCE Affected
Image SLES-SAP-Azure Image SLES-SAP-Azure-3P Image SLES-SAP-BYOS-Azure Image SLES-SAP-BYOS-EC2 Image SLES-SAP-BYOS-GCE Image SLES-SAP-EC2 Image SLES-SAP-GCE Image SLES-SAP-GCE-3P Affected
SUSE Linux Enterprise High Availability Extension 16.0 Fixed

Share

CVE-2025-40303 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy