CVE-2026-97582: hwmon: (gpio-fan) Fix use-after-free in alarm work

Published Sep 25, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

hwmon: (gpio-fan) Fix use-after-free in alarm work

fanalarmirqhandler() queues fandata->alarmwork, but nothing cancels it. fanalarmnotify() dereferences fandata and its hwmon device. On unbind, devres frees the interrupt, which only waits for the handler itself, and then releases the hwmon device and fandata, so a pending fanalarmnotify() can run after those frees.

Replace INITWORK() with devmworkautocancel(), registered before devmrequestirq(). The devres cleanup then frees the interrupt first, so no new work can be queued, and cancels the work while fandata and the hwmon device are still alive.

This issue was found by an in-house static analysis tool.

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    Replace INIT_WORK() with devm_work_autocancel(), registering it before devm_request_irq(), so the work is canceled before the interrupt is freed and before fan_data and the hwmon device are released.

    Linux kernel hwmon gpio-fan alarm_work initialization and cleanup = devm_work_autocancel() registered before devm_request_irq()

Event History

Sep 25, 2026
CVE Published
via MITRE·10:22 AM
Data Sourced
via MITRE·10:22 AM
Description
Data Sourced
via NVD·11:17 AM
Description

Frequently Asked Questions

1

When can this use-after-free occur?

It can occur when the gpio-fan driver is unbound while alarm work queued by fan_alarm_irq_handler() is still pending. The pending fan_alarm_notify() work may then access fan_data and the hwmon device after they have been released.

2

What conditions are needed to trigger the issue?

An alarm interrupt must queue alarm_work, followed by driver unbind before that queued work runs or is canceled. The issue is tied to the gpio-fan driver's alarm interrupt and its deferred notification work.

3

What is the mitigation if the fix cannot be applied immediately?

The provided data identifies unbinding the gpio-fan driver as the unsafe lifecycle event when alarm work may be pending. Avoid unbinding the driver in circumstances where its alarm interrupt could have queued work until a fixed kernel is deployed.

4

How does the fix prevent the problem?

The fix uses devm_work_autocancel() and registers it before devm_request_irq(). During cleanup, the interrupt is released first to prevent new work from being queued, then pending work is canceled while fan_data and the hwmon device still exist.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203