Skip to main content
Mallory
← Back to News
endpoint-software-vulnerabilitywidely-deployed-product-advisoryprivilege-escalation-technique

Linux kernel patches fanotify, TCP-AO, and Btrfs flaws including 17-year-old bug

Vulnerability Disclosure · 11 sources · Updated 4mo ago · First seen Oct 28, 2025

Linux kernel patches fanotify, TCP-AO, and Btrfs flaws including 17-year-old bug

Upstream Linux kernel maintainers patched three vulnerabilities reported by researchers, including two NULL pointer dereferences reachable by unprivileged users and a long-standing Btrfs memory corruption issue. CVE-2025-40072 affects fanotify mount-namespace monitoring introduced in Linux 6.16, where do_fanotify_mark() dereferenced the return value of mnt_ns_from_dentry() without verifying it was non-NULL, allowing a kernel crash and denial of service; the fix landed in 6.17.3 and 6.18-rc1. CVE-2025-39950 affects the TCP stack when TCP-AO is combined with TCP_REPAIR, causing tcp_ao_finish_connect() to dereference a NULL skb during connect() and crash the kernel.

A third fix, CVE-2025-40205, addresses a potential 8-byte out-of-bounds write in Btrfs btrfs_encode_fh() that could occur when parent and inode root IDs differ and the function reports a smaller buffer requirement than it later writes. Kernel discussions said the flaw had effectively persisted for about 17 years, with an earlier latent memory-corruption concern in the same area dating back to 2010; the final patch corrected size calculations, added bounds validation, and was marked for stable kernels back to 3.0+. Researchers said the Btrfs issue may be difficult to trigger in practice, but all three bugs were fixed upstream and highlighted as kernel stability and memory-safety risks.

Why it matters

Impact assessment

These flaws affect Linux systems running vulnerable upstream kernel versions, especially environments that expose unprivileged local user access, use fanotify namespace monitoring, enable TCP-AO with TCP_REPAIR, or rely on Btrfs. The immediate impact is primarily local denial of service through kernel crashes for CVE-2025-40072 and CVE-2025-39950, while CVE-2025-40205 introduces a memory-safety risk with potential kernel memory corruption in Btrfs.

The exposure is broad for Linux operators but practical exploitability varies by feature usage and kernel version. No reference reports confirmed exploitation in the wild; however, the bugs are reachable by unprivileged users in at least the fanotify and TCP cases, which raises multi-user host and container-host risk.

Affected populations

  • Linux administrators and platform teams running upstream or downstream kernels derived from affected branches
  • Multi-user Linux servers, shared compute environments, CI/CD runners, academic clusters, and container hosts where unprivileged local users may execute code
  • Network infrastructure or appliances using Linux TCP-AO for authenticated TCP sessions such as BGP-related use cases
  • Systems using Btrfs, particularly where exportfs/file-handle operations are exercised

Severity and business effect

  • CVE-2025-40072: local kernel crash/denial of service via fanotify mount-namespace handling
  • CVE-2025-39950: local kernel crash/denial of service via TCP-AO plus TCP_REPAIR during connect()
  • CVE-2025-40205: potential kernel memory corruption from an 8-byte out-of-bounds write in Btrfs
  • Likely operational impact: host instability, service interruption, node recycling, and possible cascading effects in clustered/containerized environments
  • No direct evidence in the references of data theft or remote code execution

Scope and exploitation status

  • Scope is widespread at the ecosystem level because Linux is broadly deployed, but practical exposure depends on enabled kernel features and filesystem choice
  • CVE-2025-40072 affects kernels starting in 6.16
  • CVE-2025-40205 persisted since Linux 2.6.29 and was marked for stable backports across many maintained branches
  • No published in-the-wild exploitation is cited in the provided references
Do you run this?See affected versions and whether adversaries are exploiting it.
Check your exposure
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

9 events · Oct 7, 2010 – Nov 12, 2025
  1. Nov 12, 20251y ago

    Linux kernel CVE team assigns CVE-2025-40205

    A Linux kernel CVE announcement assigned CVE-2025-40205 to the Btrfs btrfs_encode_fh() out-of-bounds write issue and documented fixes across stable branches, including 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 advisory recommended updating to the latest stable kernel rather than cherry-picking individual commits.

    CVE-2025-40205: btrfs: avoid potential out-of-bounds in btrfs_encode_fh() - Greg Kroah-Hartman
  2. Oct 28, 20251y ago

    Linux kernel CVE team assigns CVE-2025-40072

    A Linux kernel CVE announcement assigned CVE-2025-40072 to the fanotify NULL dereference issue and documented that it was fixed in Linux 6.17.3 and 6.18-rc1. The advisory recommended updating to the latest stable kernel rather than cherry-picking individual commits.

    CVE-2025-40072: fanotify: Validate the return value of mnt_ns_from_dentry() before dereferencing - Greg Kroah-Hartman
  3. Reported Oct 28, 20251y ago

    Fanotify mount-namespace support introduces NULL dereference bug

    The Linux kernel CVE announcement states the fanotify flaw later tracked as CVE-2025-40072 was introduced in Linux kernel 6.16 by commit 58f5fbeb367ff6f30a2448b2cad70f70b2de4b06. The bug stems from dereferencing the return value of mnt_ns_from_dentry() without checking for NULL.

    CVE-2025-40072: fanotify: Validate the return value of mnt_ns_from_dentry() before dereferencing - Greg Kroah-Hartman
  4. Oct 20, 20251y ago

    Allele Security discloses three patched Linux kernel flaws

    Allele Security published details on three Linux kernel vulnerabilities it reported: fanotify NULL dereference CVE-2025-40072, TCP NULL dereference CVE-2025-39950, and a potential Btrfs out-of-bounds write CVE-2025-40205. The post said all three fixes had already been merged upstream.

    Our recent contributions to the Linux kernel
  5. Sep 26, 20251y ago

    Btrfs btrfs_encode_fh() out-of-bounds fix committed

    David Sterba committed a Linux kernel patch fixing a potential 8-byte out-of-bounds write in Btrfs btrfs_encode_fh() by correcting size calculations and validating *max_len before writing. The commit marked the fix for stable kernels back to 3.0+.

    btrfs: avoid potential out-of-bounds in btrfs_encode_fh() · torvalds/linux@dff4f9f · GitHub
  6. Sep 14, 20251y ago

    TCP-AO and TCP_REPAIR NULL dereference fix committed

    Jakub Kicinski committed a Linux kernel fix for a NULL pointer dereference in tcp_ao_finish_connect() when TCP-AO is used with TCP_REPAIR during connect(). The patch adds a NULL check for skb before accessing tcp_hdr(skb)->seq.

    net/tcp: Fix a NULL pointer dereference when using TCP-AO with TCP_RE… · torvalds/linux@2e7bba0 · GitHub
  7. Reported Sep 8, 20251y ago

    Maintainer says Btrfs OOB patch will be re-queued

    In a mailing-list reply, David Sterba acknowledged Anderson Nascimento's Btrfs out-of-bounds fix, said the bug appeared to be 17 years old, and noted the patch had not actually been queued as believed. He said he would add it back to the for-next branch.

    Re: [PATCH] btrfs: Avoid potential out-of-bounds in btrfs_encode_fh() - David Sterba
  8. Sep 5, 20251y ago

    Fanotify NULL dereference fix committed upstream

    A Linux kernel commit added a NULL check in do_fanotify_mark() before dereferencing the result of mnt_ns_from_dentry(), preventing crashes in the FSNOTIFY_OBJ_TYPE_MNTNS path. This upstream fix is the change later associated with CVE-2025-40072.

    fanotify: Validate the return value of mnt_ns_from_dentry() before de… · torvalds/linux@62e59ff · GitHub
  9. Oct 7, 201016y ago

    Jan Beulich submits Btrfs memory corruption patch

    Jan Beulich submitted a patch to fix a latent memory corruption issue in btrfs_encode_fh() in Btrfs, adding a bounds check before writing parent_root_objectid. The mailing-list post shows the issue was recognized as early as October 2010.

    [PATCH] fix (latent?) memory corruption in btrfs_encode_fh() - Jan Beulich
Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.

Open in app →
Do you run this?See whether adversaries are exploiting this yet, and where the affected versions run in your environment.
Check Your Exposure
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.