Skip to main content

Linux Kernel CVE-2025-40205

HIGH
2025-11-12 416baaa9-dc9f-4396-8d5f-8c081fb06d67
High
Disputed · 7.8 Vendor: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Local low-priv access to Btrfs host
  2. Delivery
    Invoke file-handle encode via NFS export or name_to_handle_at
  3. Exploit
    Request connectable handle for cross-subvolume parent inode
  4. Execution
    btrfs_encode_fh writes 40 bytes into 32-byte buffer
  5. Persist
    8-byte out-of-bounds kernel heap write
  6. Impact
    Memory corruption enabling escalation or crash

Vulnerability Assessment

Exploitation Conditions

Exploitation requires local access with at least low privileges (PR:L) and invocation of the Btrfs file-handle encoding path - i.e., the volume must be NFS-exported or the attacker must call name_to_handle_at()/exportfs on a Btrfs mount. The specific vulnerable case is only reached when a CONNECTABLE handle is requested AND the parent inode's Btrfs root/subvolume ID differs from the inode's own root ID (a cross-subvolume parent relationship), AND the caller-provided *max_len buffer is smaller than BTRFS_FID_SIZE_CONNECTABLE_ROOT (40 bytes). Limiting factors that reduce realistic risk: the kernel must be built with Btrfs support and actually be encoding file handles; the non-default cross-root parent condition must hold; and the upstream maintainers explicitly describe the bug as 'not easily triggerable,' implying the undersized-buffer condition rarely arises in normal callers. No remote vector exists (AV:L).

Impact

The provided CVSS 3.1 vector (AV:L/AC:L/PR:L/UI:N, C:H/I:H/A:H, base 7.8) frames this as a locally exploitable, low-privilege, high-impact memory-corruption issue - consistent with a kernel heap overflow. However, real-world exploitation signals argue for lower priority: EPSS is only 0.07% (21st percentile), the vulnerability is NOT on the CISA KEV list, and no public exploit was identified at time of analysis. The upstream author explicitly states the issue 'does not seem to be easily triggerable,' which tempers the CVSS 'AC:L' rating - reaching the vulnerable third case requires a connectable-handle encode where the parent and inode roots differ AND a caller-supplied buffer too small to hold the 40-byte form, an uncommon combination. There is also a conflict worth flagging: CVSS marks AC:L, but the description's 'not easily triggerable' language and the requirement for a specific cross-subvolume parent relationship suggest higher practical attack complexity - treat AC:L as optimistic. Net assessment: legitimate hardening fix, low near-term exploitation risk, patch on normal kernel-update cadence rather than as an emergency.

Exploit ScenarioDerived

A local, low-privileged user on a host that exports a Btrfs volume (or one that permits name_to_handle_at) requests a connectable file handle for an inode whose parent directory lives in a different Btrfs subvolume, while supplying an undersized handle buffer. btrfs_encode_fh() then writes 40 bytes into a buffer sized for 32, overflowing 8 bytes of adjacent kernel memory and corrupting kernel heap state - potentially leading to privilege escalation or a crash. No public proof-of-concept has been identified at time of analysis, and the upstream author notes the condition is not easily triggerable.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – Jul 30, 2026

Out-of-bounds heap write in the Linux kernel's Btrfs filesystem allows local corruption of adjacent memory when btrfs_encode_fh() encodes a connectable file handle whose parent inode resides in a different subvolume/root. The function reserves only BTRFS_FID_SIZE_CONNECTABLE (32 bytes) but then writes BTRFS_FID_SIZE_CONNECTABLE_ROOT (40 bytes), producing an 8-byte overflow at fid->parent_root_objectid when the caller's buffer (*max_len) is undersized. No public exploit has been identified at time of analysis, EPSS is low (0.07%), and the upstream commit notes the condition is not easily triggerable, making this a defensive hardening fix rather than an urgent externally-exploited flaw.

Earlier versions of this analysis (1)
v1 Mar 28, 2026 - 19:21

In the Linux kernel, the following vulnerability has been resolved: btrfs: avoid potential out-of-bounds in btrfs_encode_fh() The function btrfs_encode_fh() does not properly account for the three.

RemediationAI

Patch available per vendor advisory: upgrade to a Linux kernel that includes the btrfs_encode_fh() bounds fix. Ubuntu users should apply the kernel updates in USN-8126-1 (https://ubuntu.com/security/notices/USN-8126-1) and USN-8125-1 (https://ubuntu.com/security/notices/USN-8125-1) and reboot; users of upstream/stable kernels should update to a stable release containing one of the referenced commits (e.g., 0276c8582488022f057b4cec21975a5edf079f47 or 361d67276eb8ec6be8f27f4ad6c6090459438fee) via https://git.kernel.org/. Because the fix is a source-level bounds correction with no runtime toggle, the exact patched version depends on your distribution - consult the vendor advisory for your series. As an interim compensating control where patching must be deferred, avoid exporting Btrfs filesystems over NFS and restrict use of name_to_handle_at() on Btrfs mounts, since the vulnerable encode path is only reached during file-handle encoding; the trade-off is loss of NFS export functionality for those volumes. Given the low practical triggerability, scheduled patching is preferable to disruptive workarounds.

Affected ProductsAI

The affected component is the Btrfs filesystem within the mainline and stable Linux kernel. The exact vulnerable version ranges are not enumerated in the input (CWE and per-CPE version data were not supplied), but the presence of eight separate git.kernel.org stable-branch commits (e.g., 0276c8582488022f057b4cec21975a5edf079f47, 361d67276eb8ec6be8f27f4ad6c6090459438fee, 43143776b0a7604d873d1a6f3e552a00aa930224, 60de2f55d2aca53e81b4ef2a67d7cc9e1eb677db, 742b44342204e5dfe3926433823623c1a0c581df, d3a9a8e1275eb9b87f006b5562a287aea3f6885f, d91f6626133698362bba08fbc04bd72c466806d3, dff4f9ff5d7f289e4545cc936362e01ed3252742) indicates the fix was backported across multiple stable series. Distribution exposure is confirmed for Ubuntu, which shipped kernel fixes in advisories USN-8126-1 (https://ubuntu.com/security/notices/USN-8126-1) and USN-8125-1 (https://ubuntu.com/security/notices/USN-8125-1). Only kernels built with Btrfs support and using file-handle encoding (NFS export or name_to_handle_at) exercise the vulnerable path.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The bug lives in the Btrfs (B-tree filesystem) NFS/exportfs handle-encoding path. When a filesystem is exported (e.g., over NFS) or when name_to_handle_at() is used, the VFS calls the filesystem's encode_fh operation to serialize an inode into an opaque, portable file handle (fid). Btrfs handles three cases: a non-connectable handle (5 dwords / 20 bytes), a connectable handle including parent info (8 dwords / 32 bytes), and a connectable handle where the parent inode lives in a different Btrfs root/subvolume, which additionally stores the parent's root objectid (10 dwords / 40 bytes). The defect is that the size returned/validated to the caller only ever accounts for the first two cases, so the third case writes past the caller-supplied buffer bounded by *max_len. This is a classic out-of-bounds write (CWE-787) rooted in a size-accounting mismatch between the length the function advertises and the length it actually serializes; the CWE field is marked N/A in the input but the description and 'Buffer Overflow' tag place it firmly in the OOB-write class.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

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 7.0 HIGH

Local, low-priv access (AV:L/PR:L); AC:H because it needs a non-default cross-subvolume parent plus an undersized buffer that upstream calls 'not easily triggerable'; kernel heap corruption yields high C/I/A.

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

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

4
Analysis Updated
Jul 30, 2026 - 08:19 vuln.today
v2 - CVSS changed
CVSS changed
Jul 30, 2026 - 06:37 NVD
7.8 (HIGH)
Patch released
Mar 28, 2026 - 19:31 nvd
Patch available
CVE Published
Nov 12, 2025 - 22:15 nvd
N/A

DescriptionCVE.org

In the Linux kernel, the following vulnerability has been resolved:

btrfs: avoid potential out-of-bounds in btrfs_encode_fh()

The function btrfs_encode_fh() does not properly account for the three cases it handles.

Before writing to the file handle (fh), the function only returns to the user BTRFS_FID_SIZE_NON_CONNECTABLE (5 dwords, 20 bytes) or BTRFS_FID_SIZE_CONNECTABLE (8 dwords, 32 bytes).

However, when a parent exists and the root ID of the parent and the inode are different, the function writes BTRFS_FID_SIZE_CONNECTABLE_ROOT (10 dwords, 40 bytes).

If *max_len is not large enough, this write goes out of bounds because BTRFS_FID_SIZE_CONNECTABLE_ROOT is greater than BTRFS_FID_SIZE_CONNECTABLE originally returned.

This results in an 8-byte out-of-bounds write at fid->parent_root_objectid = parent_root_id.

A previous attempt to fix this issue was made but was lost.

https://lore.kernel.org/all/4CADAEEC020000780001B32C@vpn.id2.novell.com/

Although this issue does not seem to be easily triggerable, it is a potential memory corruption bug that should be fixed. This patch resolves the issue by ensuring the function returns the appropriate size for all three cases and validates that *max_len is large enough before writing any data.

Executive ViewAI

Why It Matters

A memory corruption vulnerability in Linux kernel's Btrfs filesystem (CVE-2025-40205) allows attackers with local system access to corrupt kernel memory, risking data integrity and system stability. No active exploitation has been documented and the attack condition is difficult to trigger, reducing immediate risk. Organizations using Btrfs-based infrastructure should apply vendor patches within 30 days to harden against future exploitation.

Business Impact: Medium
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.1%
Top 79% exploitable
Prevalence
Ubiquitous
Linux kernel with Btrfs, deployed across vast numbers of systems
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
Medium

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
Container suse/hpc/warewulf4-x86_64/sle-hpc-node:latest Image SLES15-SP6 Image SLES15-SP6-BYOS Image SLES15-SP6-BYOS-Azure Image SLES15-SP6-BYOS-EC2 Image SLES15-SP6-BYOS-GCE Image SLES15-SP6-CHOST-BYOS Image SLES15-SP6-CHOST-BYOS-Aliyun Image SLES15-SP6-CHOST-BYOS-Azure Image SLES15-SP6-CHOST-BYOS-EC2 Image SLES15-SP6-CHOST-BYOS-GCE Image SLES15-SP6-CHOST-BYOS-GDC Image SLES15-SP6-CHOST-BYOS-SAP-CCloud Image SLES15-SP6-EC2 Image SLES15-SP6-EC2-ECS-HVM Image SLES15-SP6-GCE Image SLES15-SP6-HPC-BYOS Image SLES15-SP6-HPC-BYOS-Azure Image SLES15-SP6-HPC-BYOS-EC2 Image SLES15-SP6-HPC-BYOS-GCE Image SLES15-SP6-HPC-EC2 Image SLES15-SP6-HPC-GCE Image SLES15-SP6-Hardened-BYOS Image SLES15-SP6-Hardened-BYOS-Azure Image SLES15-SP6-Hardened-BYOS-EC2 Image SLES15-SP6-Hardened-BYOS-GCE Image SLES15-SP6-SAP Image SLES15-SP6-SAP-Azure Image SLES15-SP6-SAP-EC2 Image SLES15-SP6-SAP-GCE Image SLES15-SP6-SAPCAL Image SLES15-SP6-SAPCAL-Azure Image SLES15-SP6-SAPCAL-EC2 Image SLES15-SP6-SAPCAL-GCE Affected
Container suse/sl-micro/6.0/baremetal-os-container:latest Container suse/sl-micro/6.1/baremetal-os-container:latest Affected
Container suse/sl-micro/6.0/base-os-container:2.1.3-7.95 Container suse/sl-micro/6.1/base-os-container:2.2.1-5.80 Affected
Container suse/sl-micro/6.0/kvm-os-container:2.1.3-6.114 Container suse/sl-micro/6.1/kvm-os-container:2.2.1-5.82 Affected
Container suse/sl-micro/6.0/rt-os-container:2.1.3-7.116 Container suse/sl-micro/6.1/rt-os-container:2.2.1-5.55 Affected

References

Advisories & patches
ADVISORY https://ubuntu.com/security/notices/USN-8125-1 ADVISORY https://ubuntu.com/security/notices/USN-8126-1 ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:4393/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:4422/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:4505/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:4515/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:4516/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:4517/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2025:4521/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2026:20012/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2026:20015/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2026:20021/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2026:20039/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2026:20059/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2026:20334/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2026:20473/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2026:20478/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2026:20496/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2026:20519/ ADVISORY https://www.suse.com/support/update/SUSE-SU-2026:20562/ REF https://git.kernel.org/stable/c/0276c8582488022f057b4cec21975a5edf079f47 REF https://git.kernel.org/stable/c/361d67276eb8ec6be8f27f4ad6c6090459438fee REF https://git.kernel.org/stable/c/43143776b0a7604d873d1a6f3e552a00aa930224 REF https://git.kernel.org/stable/c/60de2f55d2aca53e81b4ef2a67d7cc9e1eb677db REF https://git.kernel.org/stable/c/742b44342204e5dfe3926433823623c1a0c581df REF https://git.kernel.org/stable/c/d3a9a8e1275eb9b87f006b5562a287aea3f6885f REF https://git.kernel.org/stable/c/d91f6626133698362bba08fbc04bd72c466806d3 REF https://git.kernel.org/stable/c/dff4f9ff5d7f289e4545cc936362e01ed3252742

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