i2c: designware: use casting of u64 in clock multiplication to avoid overflow
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:
i2c: designware: use casting of u64 in clock multiplication to avoid overflow
In functions i2c_dw_scl_lcnt() and i2c_dw_scl_hcnt() may have overflow by depending on the values of the given parameters including the ic_clk. For example in our use case where ic_clk is larger than one million, multiplication of ic_clk * 4700 will result in 32 bit overflow.
Add cast of u64 to the calculation to avoid multiplication overflow, and use the corresponding define for divide.
From the CVE record · Linux
The Linux kernel’s DesignWare I2C clock calculations can overflow a 32-bit multiplication when parameter values are large, such as when ic_clk exceeds one million. The input does not establish what an attacker could do or whether exploitation requires network access, local access, authentication, or user interaction.
Engineers running the Linux kernel with the DesignWare I2C driver should check their deployments; affected versions are not specified.