CVE-2024-46759: hwmon: (adc128d818) Fix underflows seen when writing limit attributes
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
hwmon: (adc128d818) Fix underflows seen when writing limit attributes
DIV_ROUND_CLOSEST() after kstrtol() results in an underflow if a large negative number such as -9223372036854775808 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-46759 to this issue.
Affected and fixed versions
===========================
Fixed in 4.19.322 with commit 05419d0056dc Fixed in 5.4.284 with commit 7645d783df23 Fixed in 5.10.226 with commit 2a3add62f183 Fixed in 5.15.167 with commit 019ef2d39636 Fixed in 6.1.110 with commit f7f5101af5b4 Fixed in 6.6.51 with commit 6891b11a0c62 Fixed in 6.10.10 with commit b0bdb43852bf Fixed in 6.11 with commit 8cad724c8537
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-46759
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/adc128d818.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/05419d0056dcf7088687e561bb583cc06deba777 https://git.kernel.org/stable/c/7645d783df23878342d5d8d22030c3861d2d5426 https://git.kernel.org/stable/c/2a3add62f183459a057336381ef3a896da01ce38 https://git.kernel.org/stable/c/019ef2d396363ecddc46e826153a842f8603799b https://git.kernel.org/stable/c/f7f5101af5b47a331cdbfa42ba64c507b47dd1fe https://git.kernel.org/stable/c/6891b11a0c6227ca7ed15786928a07b1c0e4d4af https://git.kernel.org/stable/c/b0bdb43852bf7f55ba02f0cbf00b4ea7ca897bff https://git.kernel.org/stable/c/8cad724c8537fe3e0da8004646abc00290adae40