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

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

CVE-2026-93798 is a use-after-free vulnerability in the Linux kernel's btrfs filesystem that affects reloc root cleanup operations. This article covers technical details, affected versions, 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-93798 Overview

CVE-2026-93798 is a race condition vulnerability in the Linux kernel's Btrfs filesystem code. The flaw resides in the merge_reloc_roots() function, where the kernel resets a root's ->reloc_root pointer without using memory barriers. This inconsistency with surrounding code paths can produce an observable race on concurrent CPUs. The issue also allows the BTRFS_ROOT_DEAD_RELOC_TREE flag to be cleared even when the root does not point to the expected reloc root. A local, authenticated attacker performing Btrfs relocation operations could trigger memory corruption or kernel state inconsistency, impacting confidentiality, integrity, and availability.

Critical Impact

A local attacker with low privileges can exploit a Btrfs relocation race condition to corrupt kernel memory state, potentially leading to privilege escalation or denial of service.

Affected Products

  • Linux kernel versions containing the pre-patch Btrfs merge_reloc_roots() implementation
  • Distributions shipping the vulnerable Btrfs filesystem driver
  • Systems using Btrfs volumes with relocation or balance operations enabled

Discovery Timeline

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

Technical Details for CVE-2026-93798

Vulnerability Analysis

The vulnerability lives in the Btrfs relocation code path, specifically in merge_reloc_roots(). When the subject root has zero root references in its root item, the kernel resets the root's ->reloc_root pointer directly, bypassing the memory-barrier pattern used elsewhere in the Btrfs codebase. Without the proper barrier, concurrent readers on other CPUs may observe stale or inconsistent pointer state when accessing the reloc tree.

A second logic defect compounds the issue. The kernel clears the BTRFS_ROOT_DEAD_RELOC_TREE bit from the root even when the root does not actually point to the reloc root being cleaned up. This can desynchronize relocation state tracking, leading to subsequent operations acting on stale or incorrect metadata.

The exploit scenario requires local access and the ability to invoke Btrfs operations that drive reloc tree merging, such as filesystem balance or device shrink. Successful exploitation can corrupt in-kernel filesystem state.

Root Cause

The root cause is a missing memory barrier between the write that nulls ->reloc_root and the subsequent clearing of the BTRFS_ROOT_DEAD_RELOC_TREE flag. Btrfs uses barriers consistently in equivalent paths to publish the pointer update to other CPUs before the flag transition becomes visible. The affected branch skipped this ordering, creating a window where readers could observe an inconsistent combination of pointer and flag values. The fix centralizes the logic in a clear_reloc_root() helper that enforces correct ordering.

Attack Vector

Exploitation requires local access with the ability to perform filesystem operations against a Btrfs volume. An attacker triggers relocation activity, for example through balance or snapshot operations, to race with the vulnerable code path. See the upstream fixes for technical details: Linux Kernel Commit 63d6b1f, Linux Kernel Commit ab48583a, and Linux Kernel Commit b78fe9563.

Detection Methods for CVE-2026-93798

Indicators of Compromise

  • Unexpected kernel oops or warning messages originating from fs/btrfs/relocation.c
  • Btrfs balance or device-shrink operations producing stack traces referencing merge_reloc_roots
  • Unexplained filesystem corruption or forced read-only remounts on Btrfs volumes

Detection Strategies

  • Audit running kernel versions across Linux fleets and flag hosts missing the three upstream Btrfs commits
  • Monitor dmesg and journald logs for Btrfs warnings, BUG_ON triggers, or RCU stalls that correlate with balance activity
  • Correlate local privilege escalation attempts with recent Btrfs balance, snapshot, or btrfs device operations

Monitoring Recommendations

  • Collect kernel crash dumps centrally and inspect frames involving reloc tree cleanup
  • Alert on non-administrative users initiating btrfs balance or btrfs device subcommands
  • Track package and kernel update compliance for Btrfs-enabled hosts

How to Mitigate CVE-2026-93798

Immediate Actions Required

  • Apply the vendor kernel update that includes the clear_reloc_root() fix on all Btrfs-enabled systems
  • Restrict local account access on hosts using Btrfs for root or data volumes
  • Limit which users can execute btrfs administrative subcommands by tightening sudo and capability policies

Patch Information

The upstream fix introduces a clear_reloc_root() helper that issues the required memory barrier after setting ->reloc_root to NULL and before clearing BTRFS_ROOT_DEAD_RELOC_TREE. The patch also ensures the flag is only cleared when the root points to the reloc root being processed. Review the following commits for exact changes: Linux Kernel Commit 63d6b1f, Linux Kernel Commit ab48583a, and Linux Kernel Commit b78fe9563.

Workarounds

  • Avoid running Btrfs balance and device shrink operations on untrusted multi-user systems until patched
  • Where feasible, migrate sensitive workloads off Btrfs volumes to a filesystem not affected by this flaw
  • Enforce least-privilege policies and disable local shell access for service accounts on affected hosts
bash
# Verify running kernel version and installed patch level
uname -r
# Debian/Ubuntu
apt list --installed 2>/dev/null | grep linux-image
# RHEL/Rocky/Alma
rpm -qa | grep kernel
# Restrict btrfs administrative commands to root only
chmod 700 /usr/sbin/btrfs

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.