Linux Kernel up to 6.6.116/6.12.57/6.17.7 btrfs_bio::end_io use after free

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
7.6$0-$5k0.00

Summaryinfo

A vulnerability has been found in Linux Kernel up to 6.6.116/6.12.57/6.17.7 and classified as critical. This issue affects the function btrfs_bio::end_io. Performing a manipulation results in use after free. This vulnerability is identified as CVE-2025-40303. There is not any exploit available. The affected component should be upgraded.

Detailsinfo

A vulnerability classified as critical has been found in Linux Kernel up to 6.6.116/6.12.57/6.17.7. This affects the function btrfs_bio::end_io. The manipulation with an unknown input leads to a use after free vulnerability. CWE is classifying the issue as CWE-416. Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. This is going to have an impact on confidentiality, integrity, and availability. The summary by CVE is:

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.

The advisory is shared at git.kernel.org. This vulnerability is uniquely identified as CVE-2025-40303 since 04/16/2025. The exploitability is told to be easy. Technical details are known, but no exploit is available. The price for an exploit might be around USD $0-$5k at the moment (estimation calculated on 02/23/2026).

The vulnerability scanner Nessus provides a plugin with the ID 277660 (Linux Distros Unpatched Vulnerability : CVE-2025-40303), which helps to determine the existence of the flaw in a target environment.

Upgrading to version 6.6.117, 6.12.58 or 6.17.8 eliminates this vulnerability. Applying the patch 066ee13f05fbd82ada01883e51f0695172f98dff/e2b3859067bf012d53c49b3f885fef40624a2c83/54a5b5a15588e3b0b294df31474d08a2678d4291/2618849f31e7cf51fadd4a5242458501a6d5b315 is able to eliminate this problem. The bugfix is ready for download at git.kernel.org. The best possible mitigation is suggested to be upgrading to the latest version.

The vulnerability is also documented in the databases at Tenable (277660) and CERT Bund (WID-SEC-2025-2756). If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Affected

  • Google Container-Optimized OS
  • Debian Linux
  • Amazon Linux 2
  • Red Hat Enterprise Linux
  • Ubuntu Linux
  • SUSE Linux
  • Oracle Linux
  • NetApp FAS
  • NetApp AFF
  • SUSE openSUSE
  • RESF Rocky Linux
  • Open Source Linux Kernel
  • Microsoft Azure Linux

Productinfo

Type

Vendor

Name

Version

License

Website

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔒
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 8.0
VulDB Meta Temp Score: 7.6

VulDB Base Score: 8.0
VulDB Temp Score: 7.6
VulDB Vector: 🔒
VulDB Reliability: 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔒
VulDB Temp Score: 🔒
VulDB Reliability: 🔍

Exploitinginfo

Class: Use after free
CWE: CWE-416 / CWE-119
CAPEC: 🔒
ATT&CK: 🔒

Physical: No
Local: No
Remote: Partially

Availability: 🔒
Status: Not defined

EPSS Score: 🔒
EPSS Percentile: 🔒

Price Prediction: 🔍
Current Price Estimation: 🔒

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Nessus ID: 277660
Nessus Name: Linux Distros Unpatched Vulnerability : CVE-2025-40303

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Upgrade
Status: 🔍

0-Day Time: 🔒

Upgrade: Kernel 6.6.117/6.12.58/6.17.8
Patch: 066ee13f05fbd82ada01883e51f0695172f98dff/e2b3859067bf012d53c49b3f885fef40624a2c83/54a5b5a15588e3b0b294df31474d08a2678d4291/2618849f31e7cf51fadd4a5242458501a6d5b315

Timelineinfo

04/16/2025 CVE reserved
12/08/2025 +236 days Advisory disclosed
12/08/2025 +0 days VulDB entry created
02/23/2026 +77 days VulDB entry last update

Sourcesinfo

Vendor: kernel.org

Advisory: git.kernel.org
Status: Confirmed

CVE: CVE-2025-40303 (🔒)
GCVE (CVE): GCVE-0-2025-40303
GCVE (VulDB): GCVE-100-334701
CERT Bund: WID-SEC-2025-2756 - Linux Kernel: Mehrere Schwachstellen ermöglichen Denial of Service

Entryinfo

Created: 12/08/2025 06:15
Updated: 02/23/2026 08:22
Changes: 12/08/2025 06:15 (59), 12/09/2025 03:03 (2), 01/04/2026 13:59 (7), 01/23/2026 06:40 (1), 02/23/2026 08:22 (1)
Complete: 🔍
Cache ID: 216::103

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Do you want to use VulDB in your project?

Use the official API to access entries easily!