hwmon: (pmbus/adm1266) widen blackbox-info buffer to I2C_SMBUS_BLOCK_MAX
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 15609d1893020436e1e8ccfd9ded774a96dd17a2 · < ca560f7566df7e2826c2999e959e6b94eb938f76| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
hwmon: (pmbus/adm1266) widen blackbox-info buffer to I2C_SMBUS_BLOCK_MAX
adm1266_nvmem_read_blackbox() declares a 5-byte stack buffer and passes it to i2c_smbus_read_block_data() to retrieve the 4-byte BLACKBOX_INFO response. i2c_smbus_read_block_data() does not honour caller buffer sizes -- it memcpy()s data.block[0] bytes from the SMBus transaction (where data.block[0] is the length byte returned by the slave device, up to I2C_SMBUS_BLOCK_MAX = 32):
memcpy(values, &data.block[1], data.block[0]);
If the device returns any block length above 5, the call overflows the caller's 5-byte stack buffer before the post-call
if (ret != 4) return -EIO;
check has a chance to reject the response.
Widen the local buffer to I2C_SMBUS_BLOCK_MAX so the helper has room for any well-formed SMBus block response, matching the convention used by the other i2c_smbus_read_block_data() callers in this driver.
From the CVE record · Linux
The Linux kernel's adm1266 hwmon driver passes a 5-byte stack buffer to an SMBus read function that can copy up to 32 bytes. If the device returns a block longer than 5 bytes, the copy overflows the buffer before the driver can reject the response. The input does not specify network access, authentication requirements, user interaction, or an attacker-controlled path to trigger the response.
Engineers running Linux kernels with the adm1266 hwmon driver should check whether their kernel includes the fix; affected versions were not specified.