Subject: CVE-2021-47098: hwmon: (lm90) Prevent integer overflow/underflow in hysteresis calculations

From: Greg Kroah-Hartman <[email-masked]>

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

In the Linux kernel, the following vulnerability has been resolved:

hwmon: (lm90) Prevent integer overflow/underflow in hysteresis calculations

Commit b50aa49638c7 ("hwmon: (lm90) Prevent integer underflows of
temperature calculations") addressed a number of underflow situations
when writing temperature limits. However, it missed one situation, seen
when an attempt is made to set the hysteresis value to MAX_LONG and the
critical temperature limit is negative.

Use clamp_val() when setting the hysteresis temperature to ensure that
the provided value can never overflow or underflow.

The Linux kernel CVE team has assigned CVE-2021-47098 to this issue.

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

	Issue introduced in 5.14 with commit b50aa49638c7 and fixed in 5.15.12 with commit d105f30bea91
	Issue introduced in 5.14 with commit b50aa49638c7 and fixed in 5.16 with commit 55840b9eae53

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-2021-47098
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/lm90.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/d105f30bea9104c590a9e5b495cb8a49bdfe405f
	https://git.kernel.org/stable/c/55840b9eae5367b5d5b29619dc2fb7e4596dba46