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

CVE-2026-93800: Linux Kernel Use-After-Free Vulnerability

CVE-2026-93800 is a use-after-free vulnerability in the Linux kernel btrfs filesystem that occurs during relocation error handling. This post covers technical details, affected versions, impact, and mitigation strategies.

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-93800 Overview

CVE-2026-93800 is a use-after-free vulnerability in the Linux kernel's btrfs filesystem. The flaw occurs when relocation fails in insert_dirty_subvol() after btrfs_update_reloc_root() returns an error. The root's reloc_root field is left pointing to a freed reloc root instead of being set to NULL. Later unmount operations call btrfs_put_root() on the dangling pointer, triggering a use-after-free or double-free condition. Syzbot reproduced the issue, which KASAN flagged as a slab-use-after-free in btrfs_put_root+0x2f/0x250. The vulnerability has been resolved upstream through corresponding stable kernel commits.

Critical Impact

Local triggering of the btrfs relocation error path can corrupt kernel heap memory, enabling denial of service and potential kernel memory corruption during filesystem unmount.

Affected Products

  • Linux kernel (btrfs filesystem subsystem)
  • Stable kernel branches prior to the fix commits 83201804efa4, 97a540d72ebc, and fda1b6636ff1
  • Any Linux distribution shipping an unpatched vulnerable kernel with btrfs enabled

Discovery Timeline

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

Technical Details for CVE-2026-93800

Vulnerability Analysis

The vulnerability resides in the btrfs relocation code path, specifically in the interaction between insert_dirty_subvol(), merge_reloc_root(), merge_reloc_roots(), and clean_dirty_subvols(). When btrfs_update_reloc_root() fails inside insert_dirty_subvol(), the function returns an error without adding the affected root to the rc->dirty_subvol_roots list.

The calling function merge_reloc_root() then aborts the current transaction. Up the call chain, merge_reloc_roots() adds the reloc root for root X to a local reloc_roots list and jumps to the out label, where free_reloc_roots() frees the reloc root. Because root X was never added to dirty_subvol_roots, the subsequent clean_dirty_subvols() call does not NULL out root X's ->reloc_root field.

The stale pointer persists until unmount, where btrfs_free_fs_roots() invokes btrfs_drop_and_free_fs_root(), which in turn calls btrfs_put_root() on the already-freed reloc root. KASAN reports a 4-byte write at the freed address, confirming the use-after-free.

Root Cause

The root cause is incomplete cleanup of the ->reloc_root field across error paths in the btrfs relocation state machine. The code assumed that any root whose reloc_root was freed would be present in dirty_subvol_roots, but the early error exit in insert_dirty_subvol() violates that invariant.

Attack Vector

Triggering the bug requires inducing an I/O or metadata error during btrfs balance or relocation operations on a mounted filesystem. Syzbot reproduced it using crafted loop-device images that force btrfs_update_reloc_root() to return -EIO. Exploitation requires local access and the ability to mount a controlled btrfs image or trigger the error path on an existing volume.

The vulnerability manifests in the btrfs relocation error-handling code. See the upstream commits kernel.org commit 83201804, kernel.org commit 97a540d7, and kernel.org commit fda1b663 for the patch details.

Detection Methods for CVE-2026-93800

Indicators of Compromise

  • Kernel log messages containing BTRFS error ... Transaction aborted followed by in merge_reloc_root or in merge_reloc_roots with errno -5.
  • KASAN reports of slab-use-after-free in btrfs_put_root during or after filesystem unmount.
  • Btrfs balance operations ending with status -30 and scrubs that fail to complete on the affected device.

Detection Strategies

  • Monitor dmesg and /var/log/kern.log for btrfs transaction aborts correlated with balance, relocation, or unmount events.
  • Enable KASAN on test and staging kernels to surface use-after-free conditions during fuzzing or stress testing of btrfs volumes.
  • Track kernel package versions across the fleet and flag hosts running btrfs on kernels earlier than the fix commits.

Monitoring Recommendations

  • Alert on repeated btrfs forced read-only transitions, which indicate transaction aborts that may trigger this code path.
  • Correlate mount or unmount system calls on btrfs filesystems with subsequent kernel oops or panic events.
  • Collect kernel crash dumps centrally so that use-after-free traces referencing btrfs_put_root or btrfs_drop_and_free_fs_root can be triaged.

How to Mitigate CVE-2026-93800

Immediate Actions Required

  • Apply the upstream btrfs fix by updating to a kernel that includes commits 83201804, 97a540d7, or fda1b663 from your distribution's stable series.
  • Audit systems using btrfs for root or data volumes and prioritize patching those hosts.
  • Restrict the ability of untrusted users to mount arbitrary btrfs images, for example by disabling automount of removable media.

Patch Information

The fix is available in the mainline Linux kernel and backported stable branches. Reference commits: kernel.org commit 83201804, kernel.org commit 97a540d7, and kernel.org commit fda1b663. Install the vendor-provided kernel update and reboot affected hosts.

Workarounds

  • Avoid running btrfs balance or convert operations on production volumes until the kernel is patched.
  • Where feasible, migrate workloads to an alternative filesystem such as ext4 or xfs on hosts that cannot be patched promptly.
  • Disable the btrfs kernel module on systems that do not require it to eliminate the attack surface.
bash
# Verify running kernel version and btrfs module status
uname -r
lsmod | grep btrfs

# Example: blacklist the btrfs module on hosts that do not need it
echo 'blacklist btrfs' | sudo tee /etc/modprobe.d/blacklist-btrfs.conf
sudo update-initramfs -u

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.