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

CVE-2026-98079: Linux Kernel Btrfs ZSTD Race Condition

CVE-2026-98079 is a race condition in the Linux kernel's Btrfs ZSTD workspace allocation that can cause writer tasks to sleep indefinitely. This article covers the technical details, system 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-98079 Overview

CVE-2026-98079 is a lost wakeup defect in the Linux kernel's btrfs zstd compression workspace handling. A writer task can sleep indefinitely in zstd_get_workspace() even when a workspace becomes available. The flaw stems from a race between zstd_alloc_workspace() failure handling and zstd_put_workspace() wakeup logic. When allocation fails and reclaim takes time, a returning workspace can go unnoticed, leaving the writer stuck in TASK_UNINTERRUPTIBLE state.

Critical Impact

Writer threads performing btrfs operations with zstd compression can hang indefinitely, causing filesystem I/O stalls and process-level denial of service on affected Linux systems.

Affected Products

  • Linux kernel (btrfs filesystem with zstd compression enabled)
  • Distributions shipping affected mainline and stable kernel branches
  • Systems using btrfs with the compress=zstd or compress-force=zstd mount options

Discovery Timeline

  • 2026-09-25 - CVE-2026-98079 published to NVD
  • 2026-09-30 - Last updated in NVD database

Technical Details for CVE-2026-98079

Vulnerability Analysis

The defect lives in the btrfs zstd workspace manager, which pools preallocated compression workspaces to serve concurrent writers. When no workspace is immediately available, callers enter zstd_get_workspace() and attempt to allocate a new one via kvmalloc(). If that allocation fails, the task adds itself to zwsm->wait and calls schedule() without re-checking the pool. The task relies on a future zstd_put_workspace() call to wake it.

The wakeup side uses cond_wake_up(), which only issues a wake when a waiter is already visible on the wait queue. If a workspace is returned to the pool between the failed allocation and prepare_to_wait(), no wakeup is delivered. The sleeping writer never observes the available workspace. Because only a maximum-level workspace triggers the wakeup, and one is intentionally kept allocated as the shared fallback, a single lost wakeup can strand a writer until an unrelated task returns another max-level workspace.

Root Cause

The root cause is a classic lost wakeup race condition between the allocation-failure fallback path and the workspace-return path. The ordering of prepare_to_wait() relative to the pool state check is incorrect, violating the memory-barrier contract required for sleep/wake synchronization. The window is widened by kvmalloc() entering memory reclaim, which can take significant time.

Attack Vector

The condition is reachable through normal filesystem workloads under memory pressure rather than a crafted attack. Any unprivileged workload writing to a btrfs volume with zstd compression can trigger the race when the kernel is under reclaim stress. The result is a hung writer in uninterruptible sleep that cannot be killed and may hold filesystem locks, extending the impact to other tasks.

See the upstream fix in Linux Kernel Commit 0de9f31, which re-checks the pool after prepare_to_wait() has published the waiter and uses any workspace that became available in the race window.

Detection Methods for CVE-2026-98079

Indicators of Compromise

  • Processes stuck in D (uninterruptible sleep) state with stack traces pointing to zstd_get_workspace or btrfs_compress_pages.
  • hung_task warnings in dmesg referencing btrfs compression paths after prolonged memory pressure.
  • Rising write latency on btrfs volumes mounted with compress=zstd without corresponding disk I/O saturation.

Detection Strategies

  • Monitor /proc/<pid>/stack for threads blocked in zstd_get_workspace across multiple sampling intervals.
  • Enable CONFIG_DETECT_HUNG_TASK and alert on hung_task notifications naming btrfs worker threads.
  • Correlate memory reclaim pressure metrics with btrfs writer stalls to identify race-window exposure.

Monitoring Recommendations

  • Track kernel version and btrfs mount options across the fleet to identify systems exposed to the lost wakeup race.
  • Collect dmesg and /proc/sysrq-trigger task dumps during observed filesystem stalls for root-cause analysis.
  • Alert on sustained increases in processes in uninterruptible sleep on hosts running btrfs with zstd compression.

How to Mitigate CVE-2026-98079

Immediate Actions Required

  • Apply the stable kernel update containing the fix referenced in Linux Kernel Commit 0de9f31.
  • Inventory hosts using btrfs with zstd compression and prioritize patching those under memory pressure.
  • Reboot patched hosts to activate the corrected kernel image.

Patch Information

The upstream fix re-checks the workspace pool after prepare_to_wait() publishes the waiter, closing the lost wakeup window. The patch is distributed across the following stable commits: Linux Kernel Commit 0de9f31, Linux Kernel Commit 2acb9f3, and Linux Kernel Commit d8f5704. Consult your distribution's security tracker for the specific backport version.

Workarounds

  • Switch btrfs compression to lzo or disable compression by remounting without the compress=zstd option where feasible.
  • Reduce memory pressure on affected hosts to narrow the race window until patches can be applied.
  • Avoid compress-force=zstd on write-heavy workloads running on unpatched kernels.
bash
# Check current btrfs mount options
mount | grep btrfs

# Temporarily remount without zstd compression (example)
mount -o remount,compress=lzo /mnt/data

# Verify running kernel includes the fix
uname -r

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.