Subject: CVE-2024-26664: hwmon: (coretemp) Fix out-of-bounds memory access

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

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

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

hwmon: (coretemp) Fix out-of-bounds memory access

Fix a bug that pdata->cpu_map[] is set before out-of-bounds check.
The problem might be triggered on systems with more than 128 cores per
package.

The Linux kernel CVE team has assigned CVE-2024-26664 to this issue.

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

	Issue introduced in 4.19.264 with commit 4f9dcadc55c2 and fixed in 4.19.307 with commit 93f0f4e846fc
	Issue introduced in 5.4.221 with commit c00cdfc9bd76 and fixed in 5.4.269 with commit 1eb74c00c9c3
	Issue introduced in 5.10.152 with commit d9f0159da05d and fixed in 5.10.210 with commit f0da068c75c2
	Issue introduced in 5.15.76 with commit 30cf0dee372b and fixed in 5.15.149 with commit a16afec8e83c
	Issue introduced in 6.1 with commit 7108b80a542b and fixed in 6.1.78 with commit 9bce69419271
	Issue introduced in 6.1 with commit 7108b80a542b and fixed in 6.6.17 with commit 853a6503c586
	Issue introduced in 6.1 with commit 7108b80a542b and fixed in 6.7.5 with commit 3a7753bda559
	Issue introduced in 6.1 with commit 7108b80a542b and fixed in 6.8 with commit 4e440abc8945
	Issue introduced in 6.0.6 with commit d1de8e1ae924

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-26664
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/coretemp.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/93f0f4e846fcb682c3ec436e3b2e30e5a3a8ee6a
	https://git.kernel.org/stable/c/1eb74c00c9c3b13cb65e508c5d5a2f11afb96b8b
	https://git.kernel.org/stable/c/f0da068c75c20ffc5ba28243ff577531dc2af1fd
	https://git.kernel.org/stable/c/a16afec8e83c56b14a4a73d2e3fb8eec3a8a057e
	https://git.kernel.org/stable/c/9bce69419271eb8b2b3ab467387cb59c99d80deb
	https://git.kernel.org/stable/c/853a6503c586a71abf27e60a7f8c4fb28092976d
	https://git.kernel.org/stable/c/3a7753bda55985dc26fae17795cb10d825453ad1
	https://git.kernel.org/stable/c/4e440abc894585a34c2904a32cd54af1742311b3