thermal: of: fix double-free on unregistration
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
thermal: of: fix double-free on unregistration
Since commit 3d439b1a2ad3 ("thermal/core: Alloc-copy-free the thermal zone parameters structure"), thermal_zone_device_register() allocates a copy of the tzp argument and frees it when unregistering, so thermal_of_zone_register() now ends up leaking its original tzp and double-freeing the tzp copy. Fix this by locating tzp on stack instead.
From the CVE record · Linux
The Linux kernel's thermal zone registration code can double-free a copied thermal zone parameters structure during unregistration. The input does not specify whether an attacker can trigger this, or any access, authentication, or user-interaction requirements.
Engineers running Linux kernels that include the affected thermal zone registration code should check their versions against the vendor advisory; affected versions are not specified in the input.