Skip to contentSkip to conversation

CVE-2022-49749: i2c: designware: use casting of u64 in clock multiplication to avoid overflow

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Mar 27, 2025

lore
Share & tools
lore
#0 lore raw

Description
===========

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.

The Linux kernel CVE team has assigned CVE-2022-49749 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 3.2 with commit 2373f6b9744d5373b886f3ce1a985193cca0a356 and fixed in 5.10.166 with commit ed173f77fd28a3e4fffc13b3f28687b9eba61157
	Issue introduced in 3.2 with commit 2373f6b9744d5373b886f3ce1a985193cca0a356 and fixed in 5.15.91 with commit 2f29d780bd691d20e89e5b35d5e6568607115e94
	Issue introduced in 3.2 with commit 2373f6b9744d5373b886f3ce1a985193cca0a356 and fixed in 6.1.9 with commit 9f36aae9e80e79b7a6d62227eaa96935166be9fe
	Issue introduced in 3.2 with commit 2373f6b9744d5373b886f3ce1a985193cca0a356 and fixed in 6.2 with commit c8c37bc514514999e62a17e95160ed9ebf75ca8d

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2022-49749

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
drivers/i2c/busses/i2c-designware-common.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/ed173f77fd28a3e4fffc13b3f28687b9eba61157
	https://git.kernel.org/stable/c/2f29d780bd691d20e89e5b35d5e6568607115e94
	https://git.kernel.org/stable/c/9f36aae9e80e79b7a6d62227eaa96935166be9fe
	https://git.kernel.org/stable/c/c8c37bc514514999e62a17e95160ed9ebf75ca8d