hwmon: adm1275: Prevent reading uninitialized stack
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 87102808d03948c825c3bdc48316e48f6422fd7e · < 36554592e2f5cac16ff8bf73720d38a6d9ef4a20| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
hwmon: adm1275: Prevent reading uninitialized stack
While adding support for the ROHM BD127X0 hot-swap controllers, sashiko reported an error in device-name comparison, which can lead to reading uninitialized stack memory.
Quoting Sashiko:
This is a pre-existing issue, but I noticed that just before this block in adm1275_probe(), there might be an out-of-bounds stack read:
ret = i2c_smbus_read_block_data(client, PMBUS_MFR_MODEL, block_buffer); if (ret < 0) { ... } for (mid = adm1275_id; mid->name[0]; mid++) { if (!strncasecmp(mid->name, block_buffer, strlen(mid->name))) break; }
Since i2c_smbus_read_block_data() reads up to 32 bytes into the uninitialized stack array block_buffer without appending a null terminator, strncasecmp() could read past the valid bytes returned in ret.
For example, if the device returns a shorter string like "adm12", checking it against "adm1275" up to the length of "adm1275" will continue reading into uninitialized stack bounds.
From the CVE record · Linux
The Linux kernel's adm1275 hwmon driver can read uninitialized stack memory while comparing device names during probing. This can occur when a device returns a model string shorter than the name being compared. The input does not establish an attacker path, authentication requirement, or user interaction.
Engineers running Linux kernels that include the adm1275 hwmon driver should check their kernel versions; affected versions were not specified.