hwmon: (cgbc-hwmon) Add missing NULL check after devm_kzalloc()
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:
hwmon: (cgbc-hwmon) Add missing NULL check after devm_kzalloc()
The driver allocates memory for sensor data using devm_kzalloc(), but did not check if the allocation succeeded. In case of memory allocation failure, dereferencing the NULL pointer would lead to a kernel crash.
Add a NULL pointer check and return -ENOMEM to handle allocation failure properly.
From the CVE record · Linux
The Linux kernel's cgbc-hwmon driver does not check whether a sensor-data allocation succeeds. If the allocation fails, a NULL pointer dereference can crash the kernel. The input does not describe an attacker trigger, authentication requirement, or user interaction.
Anyone running a Linux kernel with the affected cgbc-hwmon driver should check their version; affected versions are not specified.