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

CVE-2026-97521: Linux Kernel GFS2 Privilege Escalation

CVE-2026-97521 is a privilege escalation vulnerability in the Linux kernel GFS2 filesystem caused by improper locking in quota initialization. This article covers technical details, affected versions, and mitigation.

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

CVE-2026-97521 is a Linux kernel vulnerability in the GFS2 (Global File System 2) quota subsystem. The flaw occurs in gfs2_quota_init(), which scans for duplicate quota_change IDs while holding qd_lock and the quota hash bucket bitlock. The scan path calls gfs2_qd_search_bucket(), which acquires a lockref reference via lockref_get_not_dead(). On PREEMPT_RT kernels, that operation may sleep, which is prohibited under a bitlock and triggers a "sleeping function called from invalid context" condition. The bug was reported by syzbot and affects PREEMPT_RT configurations of the Linux kernel.

Critical Impact

Local triggering of the invalid context condition can destabilize GFS2-backed systems running PREEMPT_RT, leading to kernel warnings and potential denial of service on cluster file system nodes.

Affected Products

  • Linux kernel GFS2 file system module
  • Kernels built with CONFIG_PREEMPT_RT enabled
  • Cluster deployments mounting GFS2 volumes with quota support

Discovery Timeline

  • 2026-09-24 - CVE-2026-97521 published to NVD
  • 2026-09-28 - Last updated in NVD database

Technical Details for CVE-2026-97521

Vulnerability Analysis

The vulnerability resides in the GFS2 quota initialization path. During mount, gfs2_quota_init() walks on-disk quota_change records and inserts corresponding quota descriptors into the in-memory hash buckets. To detect duplicate IDs, the code calls gfs2_qd_search_bucket() while holding both qd_lock and the per-bucket bitlock.

gfs2_qd_search_bucket() invokes lockref_get_not_dead(), which uses a spinlock fallback path. Under CONFIG_PREEMPT_RT, spinlocks are converted to sleeping rt_mutex primitives. Acquiring such a lock while holding a bitlock violates the atomic context constraint and triggers the kernel's scheduling-while-atomic check.

This is a classic locking context mismatch [CWE-667]. The scope is limited to kernel stability on real-time kernels but can be triggered by crafted GFS2 images, as demonstrated by the syzbot report.

Root Cause

The root cause is the use of a reference-taking lookup helper inside a non-sleepable critical section. Bitlocks implemented via bit_spin_lock() require the surrounding code to remain non-preemptible, yet the lockref acquisition in the lookup can block on PREEMPT_RT kernels.

Attack Vector

A local actor who can mount a specially prepared GFS2 image, or an environment that exposes GFS2 mount operations to unprivileged input such as syzkaller fuzzing, can trigger the invalid context warning. No network vector is involved. The upstream fix refactors the lookup into a no-ref bucket search used during initialization, with the lockref acquisition retained for callers outside the bitlock. The duplicate-handling logic is then performed without taking an additional reference inside the critical section.

See the upstream patches for the exact code changes: kernel commit 7fdcf16e, kernel commit 812a766e, and kernel commit b99a1f0f.

Detection Methods for CVE-2026-97521

Indicators of Compromise

  • Kernel log messages containing BUG: sleeping function called from invalid context referencing gfs2_quota_init or gfs2_qd_search_bucket.
  • Call traces that include lockref_get_not_dead under bit_spin_lock frames on PREEMPT_RT kernels.
  • Unexpected GFS2 mount failures or kernel warnings on cluster nodes after mounting quota-enabled volumes.

Detection Strategies

  • Collect and parse dmesg and /var/log/messages for the specific sleeping-in-atomic warning signature tied to GFS2 code paths.
  • Inventory kernel builds and flag hosts running CONFIG_PREEMPT_RT with GFS2 mounted and quotas enabled.
  • Monitor syzbot-style fuzzing environments or test harnesses that mount arbitrary GFS2 images for the warning signature.

Monitoring Recommendations

  • Forward kernel ring buffer events to a centralized logging pipeline and alert on GFS2 BUG or WARNING entries.
  • Track kernel versions across cluster nodes to confirm patch adoption after the fix lands in your stable series.
  • Add host-level checks that verify loaded kernel includes the fix commits before enabling GFS2 quotas on PREEMPT_RT systems.

How to Mitigate CVE-2026-97521

Immediate Actions Required

  • Update to a Linux kernel release that includes the upstream fix commits for the GFS2 quota init duplicate scan.
  • Restrict mount capabilities so unprivileged users cannot supply arbitrary GFS2 images to PREEMPT_RT hosts.
  • Audit cluster nodes to confirm whether GFS2 quotas are in use and prioritize patching those systems first.

Patch Information

The fix is published across three stable kernel commits. It refactors gfs2_qd_search_bucket() to build on a no-ref bucket lookup helper, uses the no-ref variant inside the quota init critical section, and performs duplicate handling without acquiring a lockref under the bitlock. Apply the merged fix from your distribution's stable kernel update once released. Reference commits: 7fdcf16e5e14, 812a766e2b0a, and b99a1f0f18ee.

Workarounds

  • Disable GFS2 quotas by mounting with quota=off where operationally acceptable until the kernel is patched.
  • Avoid running GFS2 workloads on PREEMPT_RT kernels until the fix is deployed across the cluster.
  • Block loading of the GFS2 module on hosts that do not require it by adding install gfs2 /bin/true to a modprobe configuration file.

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.