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

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

CVE-2026-98212 is a use-after-free vulnerability in the Linux kernel mmc subsystem that can cause system instability during driver removal. This article covers technical details, affected components, 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-98212 Overview

CVE-2026-98212 is a use-after-free vulnerability in the Linux kernel's MMC (MultiMediaCard) Host Software Queue (HSQ) subsystem. The flaw lives in mmc_hsq_pump_requests(), which queues retry_work whenever request_atomic() returns -EBUSY. The sdhci-sprd driver is currently the only consumer that implements request_atomic(). Because retry_work is embedded in a devm-allocated mmc_hsq structure and is never cancelled during driver removal, pending work can execute after the devm allocation has been freed. The handler then dereferences stale hsq->mmc and hsq->mrq pointers. The issue was identified by an in-house static analysis tool and fixed upstream.

Critical Impact

Pending retry work executing after driver unbind can dereference freed memory, leading to kernel memory corruption or a crash on systems using the sdhci-sprd controller.

Affected Products

  • Linux kernel MMC subsystem (drivers/mmc/host/mmc_hsq.c)
  • Systems using the sdhci-sprd host controller driver
  • Multiple stable kernel branches referenced in the upstream fix commits

Discovery Timeline

  • 2026-10-06 - CVE-2026-98212 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-98212

Vulnerability Analysis

The Linux MMC HSQ layer provides software queuing for host controllers that support atomic request submission. When the host returns -EBUSY, mmc_hsq_pump_requests() schedules retry_work to re-attempt the request later. The mmc_hsq structure that contains this work_struct is allocated through the device-managed resource framework (devm). On driver unbind, devres releases the allocation automatically, but nothing in the removal path cancels or flushes retry_work. If the work item is still pending or executing when devm tears down the structure, the handler accesses already-freed memory via hsq->mmc and hsq->mrq. This is a classic use-after-free [CWE-416] in a kernel driver context.

Root Cause

The root cause is a lifetime mismatch between a devm-managed allocation and a workqueue item embedded inside it. The driver relies on devm to free the structure but never pairs the allocation with a cancellation of the work. Any pending retry_work after mmc_remove_host() finishes host teardown can still fire and touch freed memory.

Attack Vector

Triggering the condition requires driver unbind while a retry is queued, typically on hardware exposing the sdhci-sprd controller. A local actor with the ability to unbind the driver, or a legitimate hot-remove / module unload sequence under load, can reach the window. Exploitation of the resulting use-after-free depends on kernel heap layout and timing. The practical outcome is memory corruption or a kernel oops rather than straightforward remote code execution.

See the upstream fix commits for technical details: Kernel Git Commit 45341b3, Kernel Git Commit 5d13299, Kernel Git Commit 8439bf2, Kernel Git Commit c50d651, and Kernel Git Commit df2eb59.

Detection Methods for CVE-2026-98212

Indicators of Compromise

  • Kernel oops or BUG: KASAN: use-after-free reports referencing mmc_hsq, retry_work, or mmc_hsq_pump_requests in the call trace.
  • Unexpected kernel panics correlated with MMC driver unbind, module unload, or device hot-remove events on sdhci-sprd hardware.
  • Dmesg entries showing MMC request failures with -EBUSY immediately preceding a crash.

Detection Strategies

  • Enable KASAN (Kernel Address Sanitizer) on development and test kernels to surface use-after-free accesses in the MMC HSQ path.
  • Audit running kernel versions against the fixed commits using package inventory and uname -r data collected from endpoint telemetry.
  • Monitor system logs for workqueue handler crashes referencing freed mmc_hsq memory regions.

Monitoring Recommendations

  • Collect /var/log/kern.log and journalctl -k output into a centralized log pipeline for crash pattern analysis.
  • Alert on repeated MMC subsystem errors on devices built around Spreadtrum (sdhci-sprd) SoCs.
  • Track kernel package versions across the fleet and flag hosts that remain on unpatched stable branches.

How to Mitigate CVE-2026-98212

Immediate Actions Required

  • Apply the upstream kernel patches that convert retry_work to devm_work_autocancel() so it is cancelled and drained before the devm allocation is released.
  • Update to a Linux stable release that includes the fix commits listed in the external references.
  • Avoid runtime unbind of the sdhci-sprd driver on production systems until patched kernels are deployed.

Patch Information

The upstream fix replaces the standard work initialization with devm_work_autocancel(). By the time devres cleanup begins, mmc_remove_host() has already stopped the host, so no new requests can arm the work, and devm_work_autocancel() guarantees the pending work is cancelled before the containing allocation is freed. The fix is distributed across the kernel stable commits: 45341b3, 5d13299, 8439bf2, c50d651, and df2eb59. Verify your distribution kernel includes a backport of these commits.

Workarounds

  • Do not unload or unbind the sdhci-sprd driver while the system is active; keep the module loaded through shutdown.
  • Where feasible, blacklist runtime driver removal paths via udev or systemd policy on affected hardware.
  • Restrict local privileged access that could invoke driver unbind through /sys/bus/platform/drivers/.../unbind to reduce exposure.
bash
# Verify current kernel and check for the fix commits in the changelog
uname -r
zcat /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz 2>/dev/null | \
  grep -E '45341b3|5d13299|8439bf2|c50d651|df2eb59'

# Restrict unbind access on affected sdhci-sprd platforms
chmod 0400 /sys/bus/platform/drivers/sdhci_sprd/unbind

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.