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.
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc5:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc6:*:*:*:*:*:*

History

11 Nov 2026, 21:10

Type Values Removed Values Added
Summary
  • (es) En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: thermal: core: Abordar las condiciones de carrera en la eliminación de zonas térmicas con la reanudación Dado que thermal_zone_pm_complete() y thermal_zone_device_resume() reinicializan el trabajo retrasado de poll_queue para la zona térmica dada, el cancel_delayed_work_sync() en thermal_zone_device_unregister() puede pasar por alto algunos elementos de trabajo ya en ejecución y la zona térmica puede ser liberada prematuramente [1]. Hay dos escenarios de fallo que ambos comienzan con la ejecución de thermal_pm_notify_complete() justo antes de invocar thermal_zone_device_unregister() para una de las zonas térmicas. En el primer escenario, hay un elemento de trabajo ya en ejecución para la zona térmica dada cuando thermal_pm_notify_complete() llama a thermal_zone_pm_complete() para esa zona térmica y continúa ejecutándose cuando thermal_zone_device_unregister() comienza. Dado que el trabajo retrasado de poll_queue ha sido reinicializado por thermal_pm_notify_complete(), el elemento de trabajo en ejecución será pasado por alto por el cancel_delayed_work_sync() en thermal_zone_device_unregister() y si continúa ejecutándose después de la liberación del objeto de la zona térmica, ocurrirá un uso después de liberación. En el segundo escenario, thermal_zone_device_resume() encolado por thermal_pm_notify_complete() se ejecuta justo después de que thermal_zone_exit() llamado por thermal_zone_device_unregister() haya regresado. El trabajo retrasado de poll_queue es reinicializado por este antes de que cancel_delayed_work_sync() sea llamado por thermal_zone_device_unregister(), por lo que puede continuar ejecutándose después de la liberación del objeto de la zona térmica, lo que también conduce a un uso después de liberación. Abordar el primer escenario de fallo asegurando que ningún elemento de trabajo térmico estará en ejecución cuando se llame a thermal_pm_notify_complete(). Para este propósito, primero mover la llamada a cancel_delayed_work() de thermal_zone_pm_complete() a thermal_zone_pm_prepare() para evitar que nuevo trabajo entre en la cola de trabajo en adelante. A continuación, cambiar a usar una cola de trabajo dedicada para eventos térmicos y actualizar el código en thermal_pm_notify() para vaciar esa cola de trabajo después de que thermal_pm_notify_prepare() haya regresado, lo que se encargará de todo el trabajo térmico restante ya en la cola de trabajo (ese trabajo restante no haría nada útil de todos modos porque todas las zonas térmicas han sido marcadas como suspendidas). El segundo escenario de fallo se aborda añadiendo una comprobación de tz -> state a thermal_zone_device_resume() para evitar que reinicialice el trabajo retrasado de poll_queue si la zona térmica está desapareciendo. Tenga en cuenta que los cambios anteriores también facilitarán la reubicación de la suspensión y reanudación de las zonas térmicas más cerca de la suspensión y reanudación de los dispositivos, respectivamente.

19 Oct 2026, 20:17

Type Values Removed Values Added
CWE CWE-362

Information

Published : 2026-05-01 15:16

Updated : 2026-11-11 21:10


NVD link : CVE-2026-31731

Mitre link : CVE-2026-31731

CVE.ORG link : CVE-2026-31731


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-416

Use After Free

CWE-362

Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')