UBUNTU-CVE-2026-31731
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.
02 / AFFECTED SOFTWARE
Affected packages
6 explicit affected versions
6 explicit affected versions
35 explicit affected versions
34 explicit affected versions
27 explicit affected versions
43 explicit affected versions
15 explicit affected versions
10 explicit affected versions
3 explicit affected versions
4 explicit affected versions
19 explicit affected versions
11 explicit affected versions
50 explicit affected versions
6 explicit affected versions
12 explicit affected versions
19 explicit affected versions
10 explicit affected versions
24 explicit affected versions
10 explicit affected versions
37 explicit affected versions
26 explicit affected versions
7 explicit affected versions
40 explicit affected versions
13 explicit affected versions
44 explicit affected versions
10 explicit affected versions
18 explicit affected versions
45 explicit affected versions
13 explicit affected versions
4 explicit affected versions
20 explicit affected versions
23 explicit affected versions
52 explicit affected versions
1 explicit affected versions
21 explicit affected versions
7 explicit affected versions
16 explicit affected versions
48 explicit affected versions
8 explicit affected versions
7 explicit affected versions
12 explicit affected versions
11 explicit affected versions
7 explicit affected versions
12 explicit affected versions
14 explicit affected versions
10 explicit affected versions
1 explicit affected versions
7 explicit affected versions
17 explicit affected versions
12 explicit affected versions
10 explicit affected versions
12 explicit affected versions
41 explicit affected versions
16 explicit affected versions
17 explicit affected versions
27 explicit affected versions
10 explicit affected versions
37 explicit affected versions
10 explicit affected versions
11 explicit affected versions
13 explicit affected versions
39 explicit affected versions
10 explicit affected versions
3 explicit affected versions
10 explicit affected versions
11 explicit affected versions
26 explicit affected versions
10 explicit affected versions
7 explicit affected versions
13 explicit affected versions
29 explicit affected versions
13 explicit affected versions
12 explicit affected versions
41 explicit affected versions
40 explicit affected versions
8 explicit affected versions
33 explicit affected versions
23 explicit affected versions
10 explicit affected versions
20 explicit affected versions
19 explicit affected versions
11 explicit affected versions
5 explicit affected versions
12 explicit affected versions
11 explicit affected versions
7 explicit affected versions
12 explicit affected versions
16 explicit affected versions
5 explicit affected versions
10 explicit affected versions
26 explicit affected versions
39 explicit affected versions
35 explicit affected versions
48 explicit affected versions
11 explicit affected versions
10 explicit affected versions
13 explicit affected versions
46 explicit affected versions
16 explicit affected versions
50 explicit affected versions
3 explicit affected versions
7 explicit affected versions
51 explicit affected versions
16 explicit affected versions
18 explicit affected versions
43 explicit affected versions
12 explicit affected versions
8 explicit affected versions
5 explicit affected versions
8 explicit affected versions
10 explicit affected versions
7 explicit affected versions
46 explicit affected versions
13 explicit affected versions
13 explicit affected versions
7 explicit affected versions
8 explicit affected versions
12 explicit affected versions
9 explicit affected versions
44 explicit affected versions
16 explicit affected versions
13 explicit affected versions
26 explicit affected versions
45 explicit affected versions
37 explicit affected versions
50 explicit affected versions
14 explicit affected versions
38 explicit affected versions
9 explicit affected versions
17 explicit affected versions
11 explicit affected versions
39 explicit affected versions
18 explicit affected versions
14 explicit affected versions
6 explicit affected versions
7 explicit affected versions
10 explicit affected versions
1 explicit affected versions
13 explicit affected versions
43 explicit affected versions
16 explicit affected versions
10 explicit affected versions
8 explicit affected versions
45 explicit affected versions
14 explicit affected versions
4 explicit affected versions
78 explicit affected versions
14 explicit affected versions
11 explicit affected versions
1 explicit affected versions
1 explicit affected versions
39 explicit affected versions
03 / CONNECTIONS
Connected vulnerabilities
04 / EVIDENCE
Source records
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.
05 / REFERENCES
Further evidence
- https://git.kernel.org/linus/45b859b0728267a6199ee5002d62e6c6f3e8c89d
- https://ubuntu.com/security/CVE-2026-31731
- https://ubuntu.com/security/notices/USN-8567-1
- https://ubuntu.com/security/notices/USN-8574-1
- https://ubuntu.com/security/notices/USN-8574-2
- https://ubuntu.com/security/notices/USN-8574-3
- https://ubuntu.com/security/notices/USN-8595-1
- https://ubuntu.com/security/notices/USN-8595-2
- https://ubuntu.com/security/notices/USN-8595-3
- https://ubuntu.com/security/notices/USN-8596-1
- https://ubuntu.com/security/notices/USN-8606-1
- https://ubuntu.com/security/notices/USN-8607-1
- https://ubuntu.com/security/notices/USN-8608-1
- https://ubuntu.com/security/notices/USN-8609-1
- https://ubuntu.com/security/notices/USN-8619-1
- https://www.cve.org/CVERecord?id=CVE-2026-31731