CVE-2025-38297: PM: EM: Fix potential division-by-zero error in em_compute_costs()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
PM: EM: Fix potential division-by-zero error in em_compute_costs()
When the device is of a non-CPU type, table[i].performance won't be initialized in the previous em_init_performance(), resulting in division by zero when calculating costs in em_compute_costs().
Since the 'cost' algorithm is only used for EAS energy efficiency calculations and is currently not utilized by other device drivers, we should add the _is_cpu_device(dev) check to prevent this division-by-zero issue.
The Linux kernel CVE team has assigned CVE-2025-38297 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.9 with commit 1b600da510735a0f92c8b4140a7e2cb037a6a6c3 and fixed in 6.12.34 with commit 81d72f9241d884ec29524431f74f8009310cfa0c Issue introduced in 6.9 with commit 1b600da510735a0f92c8b4140a7e2cb037a6a6c3 and fixed in 6.15.3 with commit 14cbdd64f3870cf0a2d94b87919b9056448c59a0 Issue introduced in 6.9 with commit 1b600da510735a0f92c8b4140a7e2cb037a6a6c3 and fixed in 6.16-rc1 with commit 179c0c7044a378198adb36f2a12410ab68cc730a
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-2025-38297
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:
kernel/power/energy_model.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/81d72f9241d884ec29524431f74f8009310cfa0c https://git.kernel.org/stable/c/14cbdd64f3870cf0a2d94b87919b9056448c59a0 https://git.kernel.org/stable/c/179c0c7044a378198adb36f2a12410ab68cc730a