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
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
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
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
Analysis Updated
Jul 30, 2026 - 08:19 vuln.today
v2 (cvss_changed)
Re-analysis Queued
Jul 30, 2026 - 06:37 vuln.today
cvss_changed
CVSS changed
Jul 30, 2026 - 06:37 NVD
7.8 (HIGH)
Patch released
Mar 28, 2026 - 19:31 nvd
Patch available
Analysis Generated
Mar 28, 2026 - 19:21 vuln.today
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.

AnalysisAI

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.

Technical ContextAI

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.

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.

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.

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

Share

CVE-2025-40205 vulnerability details – vuln.today

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