Skip to contentSkip to conversation

CVE-2026-99716: hwmon: (coretemp) Set nr_cores only after core_data allocation succeeds

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Nov 20

lore
Share & tools
lore
#0 lore raw

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

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

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

hwmon: (coretemp) Set nr_cores only after core_data allocation succeeds

In init_temp_data(), pdata->nr_cores is populated from topology_num_cores_per_package() before allocating pdata->core_data. If that allocation fails, init_temp_data() returns NULL with pdata->core_data still NULL and pdata->nr_cores set to a positive value.

coretemp_add_core() logs the error without failing coretemp_cpu_online(), so the CPU still comes online with pdata->hwmon_dev registered. When the CPU is later taken offline (or the module is unloaded), coretemp_cpu_offline() calls get_temp_data(pd, cpu), which loops up to pdata->nr_cores and dereferences the NULL pdata->core_data pointer.

Store the core count in a local variable and assign pdata->nr_cores only after pdata->core_data is allocated, preserving the invariant that pdata->nr_cores is zero whenever pdata->core_data is NULL.

The Linux kernel CVE team has assigned CVE-2026-99716 to this issue.

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

	Issue introduced in 6.9 with commit 1a793caf6f6991716cb07583ed7c27de84ef0cba and fixed in 7.3.5 with commit 2fb99a03cb8c4a5907c55968d1aa8df6c885e347
	Issue introduced in 6.9 with commit 1a793caf6f6991716cb07583ed7c27de84ef0cba and fixed in 7.4-rc2 with commit 95638f1f05ced75a82e83f610cd01b636d2a21b1

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-2026-99716

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/2fb99a03cb8c4a5907c55968d1aa8df6c885e347
	https://git.kernel.org/stable/c/95638f1f05ced75a82e83f610cd01b636d2a21b1