thermal: core: Fix thermal zone device registration error path
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
02871710b93058eb1249d5847c0b2d1c2c3c98ae| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
thermal: core: Fix thermal zone device registration error path
If thermal_zone_device_register_with_trips() fails after registering a thermal zone device, it needs to wait for the tz->removal completion like thermal_zone_device_unregister(), in case user space has managed to take a reference to the thermal zone device's kobject, in which case thermal_release() may not be called by the error path itself and tz may be freed prematurely.
Add the missing wait_for_completion() call to the thermal zone device registration error path.
From the CVE record · Linux
The Linux kernel's thermal zone device registration error path can free a device prematurely if registration fails after the device is registered and user space has taken a reference to its kobject. This can cause a use-after-free; the input does not specify authentication requirements or whether further user interaction is needed.
Engineers running Linux kernels should check their versions against the vendor advisory; affected versions are not specified here.