Skip to main content
Mallory
HighVulnerability

CVE-2025-40205: Out-of-bounds write in Linux kernel Btrfs file-handle encoding

Published Nov 12, 2025 · Updated today
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS7.8High · v3.1
EPSS0.16%5th percentile
CISA KEVNoNot listed
In the wildNoneNo exploitation reported
Vendor
Linux
IdentifiersCVE-2025-40205CWE-787

CVE-2025-40205 is an out-of-bounds write vulnerability in the Linux kernel Btrfs btrfs_encode_fh() function, introduced in Linux 2.6.29. The function accounts for file handles requiring 20 or 32 bytes but fails to correctly validate the 40-byte format needed when a parent exists and its root ID differs from the inode's root ID. With an insufficient buffer length, assigning the parent root object ID causes an 8-byte out-of-bounds write. The flaw can corrupt kernel memory, although a realistic trigger has not been fully demonstrated and the condition is considered difficult to trigger.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Potential kernel memory corruption, system instability, and denial of service through an 8-byte out-of-bounds write. Severity assessments differ on confidentiality and integrity consequences; arbitrary code execution, privilege escalation, and information disclosure have not been demonstrated.

Mitigation

If you can’t patch tonight, do this now.

No vulnerability-specific workaround is established. Until the kernel can be updated, limit untrusted local access and restrict access to affected kernel interfaces where operationally feasible. These measures reduce exposure but do not correct the buffer-length validation flaw.

Remediation

Patch, then assume compromise.

Upgrade to a supported distribution kernel containing the fix and reboot into the updated kernel. Upstream fixed releases include 5.4.301, 5.10.246, 5.15.195, 6.1.157, 6.6.113, 6.12.54, 6.17.4, and 6.18-rc1. The fix calculates the required size for all three file-handle formats and checks *max_len before writing any data. Distribution backports may use different version numbers. Prefer a current supported kernel update rather than cherry-picking individual commits.

Public exploits

Exploits

No public exploits tracked yet. Mallory keeps watching.

View more in app →
No public exploit code observed for this vulnerability. Mallory keeps watching.
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
LinuxLinux Kerneloperating_system
FAQ

Frequently asked questions

Is CVE-2025-40205 exploited in the wild?
As of Dec 4, 2026, Mallory has no reports of CVE-2025-40205 being exploited in the wild. It is not listed in CISA KEV.
Is there a public exploit for CVE-2025-40205?
As of Dec 4, 2026, Mallory has found no public exploit for CVE-2025-40205.
Is there a patch for CVE-2025-40205?
Upgrade to a supported distribution kernel containing the fix and reboot into the updated kernel. Upstream fixed releases include 5.4.301, 5.10.246, 5.15.195, 6.1.157, 6.6.113, 6.12.54, 6.17.4, and 6.18-rc1.
What products are affected by CVE-2025-40205?
Linux Kernel.
How severe is CVE-2025-40205?
CVE-2025-40205 has a CVSS v3.1 score of 7.8 (High) and an EPSS score of 0.16% (5th percentile) as of Dec 4, 2026.
Activity feed

Recent activity

21 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
tenable cloud security pluginsNews · Oct 4, 2026Google: sys-kernel/csql-kernel-6_12, sys-kernel/csql-kernel-6_... | Tenable®A memory-corruption vulnerability in the Linux kernel's Btrfs btrfs_encode_fh() function caused by incorrect file-handle size accounting and insufficient buffer-length validation. The content notes that triggering the flaw does not appear easy. It lists a CVSS v3 base score of 7.8 with local access and low privileges required. The fix checks the correct size for all three file-handle cases before writing data.Read more ↗tenable nessus pluginsNews · Aug 21, 2026Unity Linux 20.1050e Security Update: kernel (UTSA-2026-102073) | Tenable®A Linux kernel Btrfs vulnerability in btrfs_encode_fh() that can cause an out-of-bounds write due to incorrect file handle size accounting, leading to potential memory corruption.Read more ↗lore kernelNews · Nov 12, 2025CVE-2025-40205: btrfs: avoid potential out-of-bounds in btrfs_encode_fh() - Greg Kroah-HartmanA Linux kernel Btrfs vulnerability in btrfs_encode_fh() that can cause an 8-byte out-of-bounds write due to incorrect size handling across file handle encoding cases, leading to potential memory corruption.Read more ↗ubuntuNews · Nov 12, 2025CVE-2025-40205 | UbuntuA memory-corruption vulnerability in the Linux kernel's Btrfs btrfs_encode_fh() function. When a parent and inode have different root IDs, the function can write a 40-byte file handle despite previously indicating that only 32 bytes are required, causing an 8-byte out-of-bounds write if the supplied buffer is insufficient. The advisory describes the issue as not easily triggerable. Its scoring specifies local access, low privileges, and no user interaction: CVSS v3.1 is 7.8 (High), CVSS v4.0 is 6.9 (Medium), and Ubuntu assigns Medium priority. The patch corrects size reporting and validates buffer capacity before writing. Ubuntu's standard linux package is fixed in 6.17.0-14.14 for 25.10, 6.8.0-106.106 for 24.04 LTS, and 5.15.0-170.180 for 22.04 LTS; several older release/package combinations remain vulnerable or unsupported.Read more ↗
+2 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malwareMalware families linked to this CVE, with evidence and IOCs.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity3Community discussion across Reddit, Mastodon, and other social sources.