CVE-2026-31731CWE-362CWE-416

CVE-2026-31731

High · published May 1, 2026

CVSS v3.1
7.8
EPSS
0%
Percentile
2.5
In the wild
Unconfirmed
What it is

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

thermal: core: Address thermal zone removal races with resume

Since thermal_zone_pm_complete() and thermal_zone_device_resume()

re-initialize the poll_queue delayed work for the given thermal zone,

the cancel_delayed_work_sync() in thermal_zone_device_unregister()

may miss some already running work items and the thermal zone may

be freed prematurely [1].

There are two failing scenarios that both start with

running thermal_pm_notify_complete() right before invoking

thermal_zone_device_unregister() for one of the thermal zones.

In the first scenario, there is a work item already running for

the given thermal zone when thermal_pm_notify_complete() calls

thermal_zone_pm_complete() for that thermal zone and it continues to

run when thermal_zone_device_unregister() starts. Since the poll_queue

delayed work has been re-initialized by thermal_pm_notify_complete(), the

running work item will be missed by the cancel_delayed_work_sync() in

thermal_zone_device_unregister() and if it continues to run past the

freeing of the thermal zone object, a use-after-free will occur.

In the second scenario, thermal_zone_device_resume() queued up by

thermal_pm_notify_complete() runs right after the thermal_zone_exit()

called by thermal_zone_device_unregister() has returned. The poll_queue

delayed work is re-initialized by it before cancel_delayed_work_sync() is

called by thermal_zone_device_unregister(), so it may continue to run

after the freeing of the thermal zone object, which also leads to a

use-after-free.

Address the first failing scenario by ensuring that no thermal work

items will be running when thermal_pm_notify_complete() is called.

For this purpose, first move the cancel_delayed_work() call from

thermal_zone_pm_complete() to thermal_zone_pm_prepare() to prevent

new work from entering the workqueue going forward. Next, switch

over to using a dedicated workqueue for thermal events and update

the code in thermal_pm_notify() to flush that workqueue after

thermal_pm_notify_prepare() has returned which will take care of

all leftover thermal work already on the workqueue (that leftover

work would do nothing useful anyway because all of the thermal zones

have been flagged as suspended).

The second failing scenario is addressed by adding a tz->state check

to thermal_zone_device_resume() to prevent it from re-initializing

the poll_queue delayed work if the thermal zone is going away.

Note that the above changes will also facilitate relocating the suspend

and resume of thermal zones closer to the suspend and resume of devices,

respectively.

The record
Technical detail
CVSS v3.1
7.8 · HIGH
Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.00131 · 2.5th percentile
Weaknesses
CWE-362 · Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'); CWE-416 · Use After Free
Published
2026-05-01T19:16Z
Affected products (9)
ProductVersionsFixed in
linux/linux_kernel≥ 6.8, < 6.12.836.12.83
linux/linux_kernel≥ 6.13, < 6.18.226.18.22
linux/linux_kernel≥ 6.19, < 6.19.126.19.12
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
References (4)
EPSS history
Timeline
  • 01 MAY 14:14Z
    thermal: core: Address thermal zone removal races with resume
    cvelistv5