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

CVE-2026-93285: Linux Kernel f2fs Race Condition Vulnerability

CVE-2026-93285 is a race condition vulnerability in the Linux kernel f2fs filesystem that affects memory management during teardown. This article covers technical details, affected versions, impact, 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-93285 Overview

CVE-2026-93285 is a race condition vulnerability in the Linux kernel's Flash-Friendly File System (f2fs). The flaw affects the garbage collection (GC) kernel thread lifecycle managed through f2fs_sb_info. During remount or shutdown operations, f2fs_stop_gc_thread can set sbi->gc_thread to NULL while a concurrent sysfs __sbi_store handler accesses sbi->gc_thread->f2fs_gc_task. The upstream fix embeds f2fs_gc_kthread directly in f2fs_sb_info rather than allocating it dynamically, simplifying lifetime management and closing the teardown race window.

Critical Impact

A concurrent access to a freed or nullified gc_thread pointer during filesystem teardown can lead to a kernel NULL pointer dereference or use-after-free, potentially causing a denial of service or local privilege escalation on affected systems.

Affected Products

  • Linux kernel versions containing the dynamically allocated f2fs_gc_kthread structure in the f2fs subsystem
  • Distributions shipping unpatched upstream f2fs code prior to the referenced stable commits
  • Systems that mount f2fs volumes and expose f2fs sysfs tunables

Discovery Timeline

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

Technical Details for CVE-2026-93285

Vulnerability Analysis

The vulnerability resides in the f2fs garbage collection thread management code. The f2fs_sb_info superblock structure holds a pointer, gc_thread, to a dynamically allocated f2fs_gc_kthread object. This object stores runtime state including f2fs_gc_task, the task_struct for the GC kernel thread.

Two kernel paths touch this pointer without adequate synchronization. The sysfs write handler __sbi_store dereferences sbi->gc_thread to adjust tunables. Concurrently, f2fs_stop_gc_thread, invoked during remount or shutdown, tears down and nullifies the same pointer. The resulting race allows a sysfs writer to dereference sbi->gc_thread->f2fs_gc_task after the backing memory has been freed or the pointer has been set to NULL.

The fix embeds f2fs_gc_kthread directly inside f2fs_sb_info. The structure's lifetime now matches the superblock, eliminating the need to free the sub-object and removing the window in which a stale pointer can be dereferenced.

Root Cause

The root cause is a race condition [CWE-362] between the sysfs tunable write path and the GC thread teardown path. Dynamic allocation of f2fs_gc_kthread combined with pointer nullification during teardown created a Time-of-Check Time-of-Use (TOCTOU) condition. No lock or RCU barrier serialized access between sysfs readers of sbi->gc_thread and the teardown routine.

Attack Vector

An attacker with the ability to trigger f2fs sysfs writes and induce a remount or shutdown of the mounted f2fs volume can race the two code paths. Successful exploitation requires local access and permission to write to the relevant f2fs sysfs entries. The outcome ranges from kernel panic to memory corruption, depending on allocator state at the moment of the dereference.

No verified public exploit code is available for CVE-2026-93285. The upstream commits referenced in the advisory contain the authoritative technical details of the fix.

Detection Methods for CVE-2026-93285

Indicators of Compromise

  • Kernel oops or panic traces referencing f2fs_gc_kthread, sbi->gc_thread, or f2fs_stop_gc_thread in dmesg or /var/log/kern.log
  • Unexpected process termination or node reboots coinciding with f2fs remount, shutdown, or sysfs write activity
  • KASAN reports flagging use-after-free or NULL pointer dereference in fs/f2fs/gc.c or fs/f2fs/sysfs.c

Detection Strategies

  • Monitor kernel logs for stack traces that include f2fs GC symbols combined with BUG: or general protection fault messages
  • Audit the running kernel version against the fixed stable commits 23eee01, 3d7bca9, and 99d14d6
  • Enable KASAN on test systems to surface racing accesses to the gc_thread pointer during fuzzing of f2fs sysfs entries

Monitoring Recommendations

  • Alert on unexpected f2fs mount, remount, or shutdown events on production hosts
  • Track write activity against /sys/fs/f2fs/<device>/ tunables and correlate with filesystem state changes
  • Collect kernel crash dumps centrally to identify patterns consistent with this race condition

How to Mitigate CVE-2026-93285

Immediate Actions Required

  • Identify all Linux systems mounting f2fs volumes and inventory their kernel versions
  • Apply the stable kernel update that incorporates commits 23eee01c732e, 3d7bca9d5837, and 99d14d61aa8b
  • Restrict write permissions on f2fs sysfs tunables to privileged users only

Patch Information

The fix is published in the mainline and stable Linux kernel trees. Review the upstream commits for the exact change: Kernel Git Commit 23eee01, Kernel Git Commit 3d7bca9, and Kernel Git Commit 99d14d6. Rebuild and deploy a kernel that contains these commits, or install the corresponding distribution-provided update.

Workarounds

  • Avoid concurrent f2fs remount or shutdown operations alongside sysfs tunable writes until the kernel is patched
  • Where feasible, migrate workloads from f2fs to a filesystem not affected by this specific race until the kernel update is deployed
  • Limit non-root access to filesystem management operations through sudo policies and namespace restrictions
bash
# Verify running kernel version and confirm patch presence
uname -r

# List mounted f2fs filesystems
mount | grep f2fs

# Restrict access to f2fs sysfs tunables (example)
chmod 600 /sys/fs/f2fs/*/gc_*

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.