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

CVE-2026-97582: Linux Kernel GPIO Fan Use-After-Free

CVE-2026-97582 is a use-after-free vulnerability in the Linux kernel GPIO fan driver that occurs during device unbind 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-97582 Overview

CVE-2026-97582 is a use-after-free vulnerability in the Linux kernel's gpio-fan hwmon driver. The flaw resides in the fan alarm interrupt handling logic, where fan_alarm_irq_handler() queues fan_data->alarm_work without a mechanism to cancel pending work during driver unbind. When the driver unbinds, devres frees the interrupt and then releases the hwmon device and fan_data, but a previously queued fan_alarm_notify() can still execute and dereference freed memory. The issue was identified by an in-house static analysis tool and fixed upstream by replacing INIT_WORK() with devm_work_autocancel().

Critical Impact

A pending workqueue callback can dereference freed kernel memory during driver unbind, leading to potential kernel memory corruption or denial of service.

Affected Products

  • Linux kernel hwmon subsystem (gpio-fan driver)
  • Linux stable branches prior to the patched commits
  • Systems using GPIO-based fan controllers with alarm interrupts enabled

Discovery Timeline

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

Technical Details for CVE-2026-97582

Vulnerability Analysis

The gpio-fan driver registers an interrupt handler, fan_alarm_irq_handler(), that schedules deferred work via fan_data->alarm_work. The scheduled callback, fan_alarm_notify(), dereferences fan_data and its associated hwmon device to emit a sysfs notification. The driver originally initialized the work item with INIT_WORK() and never explicitly cancelled it during teardown.

On driver unbind, the device resource manager (devres) releases the interrupt first. That release path waits only for the running interrupt handler to complete, not for any work the handler has already enqueued. The hwmon device and fan_data are then freed. If the workqueue has not yet dispatched the pending fan_alarm_notify() call, the callback runs against freed structures.

Root Cause

The root cause is a missing lifetime binding between the enqueued work item and the devres-managed resources. INIT_WORK() creates no cleanup obligation, so the kernel has no guarantee that alarm_work is drained before fan_data is released. This is a classic use-after-free pattern between an interrupt-driven producer and a managed resource consumer.

Attack Vector

Triggering the condition requires an unbind of the gpio-fan driver concurrent with a pending alarm interrupt. Local privileged operations such as unbinding via sysfs, module removal, or device hot-removal are the plausible paths. The vulnerability is not exposed over the network and requires local access to kernel-managed device nodes. See the upstream fix at Kernel Git Commit 9b12bd7 for the full patch context.

Detection Methods for CVE-2026-97582

Indicators of Compromise

  • Kernel oops or panic messages referencing fan_alarm_notify or gpio_fan after a device unbind or module unload event.
  • KASAN use-after-free reports naming the alarm_work work item or fan_data structure.
  • Unexpected system instability on hardware platforms that expose GPIO fan alarms.

Detection Strategies

  • Audit running kernel versions against the fixed commits referenced in the kernel.org advisories to identify unpatched hosts.
  • Enable KASAN in test or staging kernels to surface use-after-free conditions during driver unbind stress tests.
  • Monitor dmesg and persistent kernel logs for stack traces that include gpio-fan symbols following device management operations.

Monitoring Recommendations

  • Collect kernel crash dumps centrally and parse them for symbols associated with hwmon and gpio-fan.
  • Alert on module unload or driver unbind events on systems that have GPIO fan controllers configured.
  • Track kernel package versions across the fleet and flag hosts lagging behind stable kernel updates.

How to Mitigate CVE-2026-97582

Immediate Actions Required

  • Apply the upstream kernel patches that replace INIT_WORK() with devm_work_autocancel() in the gpio-fan driver.
  • Update to a stable Linux kernel release that includes commits 30755d3, 9b12bd7, a2471ed, or c6ab7f8.
  • Restrict privileged access to sysfs bind/unbind interfaces on affected systems until patched.

Patch Information

The fix registers devm_work_autocancel() before devm_request_irq(). During devres cleanup, the interrupt is freed first so no new work can be queued, and the work item is cancelled while fan_data and the hwmon device are still valid. Distribution vendors should backport the commits linked above into their supported stable kernel branches.

Workarounds

  • Avoid runtime unbinding or module unloading of the gpio-fan driver on production systems until the patched kernel is deployed.
  • Where feasible, disable the alarm GPIO in device tree configuration to prevent fan_alarm_irq_handler() from queuing work.
  • Limit local privileged access to reduce the opportunity for an attacker to trigger the unbind race.
bash
# Verify current kernel version and check for the gpio-fan driver
uname -r
lsmod | grep gpio_fan

# After patching, confirm the fixed kernel is running
dmesg | grep -i gpio-fan

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.