Skip to main content
Vulnerability Database/CVE-2026-97415

CVE-2026-97415: Linux Kernel Btrfs Buffer Overflow Vulnerability

CVE-2026-97415 is a buffer overflow flaw in the Linux kernel btrfs filesystem that allows corrupted items to cause out-of-bounds memory access. This post explains its technical details, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-97415 Overview

CVE-2026-97415 is a Linux kernel vulnerability in the btrfs filesystem. The tree-checker fails to validate ROOT_REF and ROOT_BACKREF items before readers consume them. These items contain a struct btrfs_root_ref followed by a subvolume name, and multiple readers trust the on-disk name_len without bounds checks.

A corrupted item can cause readers to access memory outside the item buffer. The BTRFS_IOC_GET_SUBVOL_INFO ioctl can also copy excess bytes into its fixed-size UAPI name buffer, leading to kernel memory disclosure or corruption.

Critical Impact

A local user mounting or interacting with a crafted btrfs image can trigger out-of-bounds reads in kernel space, risking information disclosure, memory corruption, and denial of service.

Affected Products

  • Linux kernel versions containing the btrfs tree-checker prior to the fix commits
  • Distributions shipping unpatched btrfs with BTRFS_IOC_GET_SUBVOL_INFO support
  • Systems that mount or process untrusted btrfs filesystem images

Discovery Timeline

  • 2026-09-24 - CVE-2026-97415 published to NVD
  • 2026-09-25 - Last updated in NVD database

Technical Details for CVE-2026-97415

Vulnerability Analysis

The btrfs on-disk format stores ROOT_REF and ROOT_BACKREF records as a fixed struct btrfs_root_ref header followed by a variable-length subvolume name. Readers derive the name pointer and length from the on-disk header rather than from validated metadata. When the stored name_len is larger than the actual item payload, dereferences read past the end of the item in the extent buffer.

The BTRFS_IOC_GET_SUBVOL_INFO ioctl compounds the issue by using the item size to compute how many bytes to copy into a fixed-size UAPI buffer defined by BTRFS_NAME_LEN. A crafted item can therefore overflow the destination name field in the ioctl response structure.

Root Cause

The tree-checker did not enforce invariants for ROOT_REF and ROOT_BACKREF items at read time. Specifically, it accepted records with empty names, with name_len values that did not match the remaining item payload, and with names exceeding BTRFS_NAME_LEN. This is an input validation failure that enables out-of-bounds reads [CWE-125] and improper buffer handling in a kernel-exposed interface.

Attack Vector

Exploitation requires local access and the ability to supply a malicious btrfs image, for example through a USB device, loopback mount, or a shared filesystem image. Once mounted, any code path that iterates ROOT_REF or ROOT_BACKREF items triggers the unsafe read. An unprivileged caller invoking BTRFS_IOC_GET_SUBVOL_INFO on an affected subvolume can additionally obtain kernel memory contents through the oversized copy. See the upstream fixes kernel commit 0af37c2, kernel commit 74f577c, and kernel commit 9154542 for the validation logic added to the tree-checker.

Detection Methods for CVE-2026-97415

Indicators of Compromise

  • Kernel log entries from btrfs_check_leaf or the tree-checker reporting corrupt ROOT_REF or ROOT_BACKREF items
  • Unexpected KASAN or slab-out-of-bounds reports in btrfs read paths after mount or ioctl operations
  • Processes invoking BTRFS_IOC_GET_SUBVOL_INFO on removable or untrusted btrfs volumes

Detection Strategies

  • Monitor dmesg and syslog for btrfs tree-checker warnings and transaction aborts tied to subvolume metadata
  • Audit mount events for btrfs images originating from removable media, user home directories, or network shares
  • Track processes issuing btrfs ioctls on recently mounted filesystems using eBPF or auditd rules

Monitoring Recommendations

  • Alert on repeated btrfs mount failures or EUCLEAN errors from untrusted sources
  • Correlate kernel memory corruption indicators with filesystem activity timelines
  • Review privileged ioctl usage on multi-tenant hosts and container nodes using btrfs backends

How to Mitigate CVE-2026-97415

Immediate Actions Required

  • Apply the upstream btrfs tree-checker patches and rebuild or update the kernel
  • Restrict mounting of untrusted btrfs images by non-root users and disable automatic mounting of removable media where feasible
  • Audit container and VM hosts that expose btrfs subvolumes to tenants and limit ioctl access

Patch Information

The fix validates ROOT_REF and ROOT_BACKREF items in the tree-checker before any reader uses them. It rejects records without a non-empty name, with a name_len that does not match the remaining payload, or with names exceeding BTRFS_NAME_LEN. The BTRFS_IOC_GET_SUBVOL_INFO ioctl now copies only the validated name_len and relies on the zeroed allocation to preserve the trailing null byte. See kernel commit 0af37c2, kernel commit 74f577c, and kernel commit 9154542.

Workarounds

  • Disable user-space mounting of btrfs by removing the SUID bit from mount helpers or policy configuration
  • Block automount of removable devices via udev rules until the kernel is patched
  • Avoid exposing BTRFS_IOC_GET_SUBVOL_INFO to untrusted workloads through container seccomp profiles

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.