CVE-2024-53159: hwmon: (nct6775-core) Fix overflows seen when writing limit attributes
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
hwmon: (nct6775-core) Fix overflows seen when writing limit attributes
DIV_ROUND_CLOSEST() after kstrtoul() results in an overflow if a large number such as 18446744073709551615 is provided by the user. Fix it by reordering clamp_val() and DIV_ROUND_CLOSEST() operations.
The Linux kernel CVE team has assigned CVE-2024-53159 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.19 with commit c3963bc0a0cf9ecb205a9d4976eb92b6df2fa3fd and fixed in 6.1.120 with commit ae703f8ff083c5267af30d6c8cf096d562623b3b Issue introduced in 5.19 with commit c3963bc0a0cf9ecb205a9d4976eb92b6df2fa3fd and fixed in 6.6.64 with commit 685c10269c41d23d7a2b85d3fd6b6345390c8746 Issue introduced in 5.19 with commit c3963bc0a0cf9ecb205a9d4976eb92b6df2fa3fd and fixed in 6.11.11 with commit a4712e4485f5c388bbe0d0e8f52978241ab34a29 Issue introduced in 5.19 with commit c3963bc0a0cf9ecb205a9d4976eb92b6df2fa3fd and fixed in 6.12.2 with commit dfa8bedfffcae87976b34a45a724deb9c3a0a88e Issue introduced in 5.19 with commit c3963bc0a0cf9ecb205a9d4976eb92b6df2fa3fd and fixed in 6.13-rc1 with commit 57ee12b6c514146c19b6a159013b48727a012960
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-2024-53159
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/hwmon/nct6775-core.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/ae703f8ff083c5267af30d6c8cf096d562623b3b https://git.kernel.org/stable/c/685c10269c41d23d7a2b85d3fd6b6345390c8746 https://git.kernel.org/stable/c/a4712e4485f5c388bbe0d0e8f52978241ab34a29 https://git.kernel.org/stable/c/dfa8bedfffcae87976b34a45a724deb9c3a0a88e https://git.kernel.org/stable/c/57ee12b6c514146c19b6a159013b48727a012960