Skip to contentSkip to conversation

CVE-2026-31744: PM: EM: Fix NULL pointer dereference when perf domain ID is not found

DISCUSSION Greg Kroah-Hartman 1 participant 1 message May 1

lore
Share & tools
lore
#0 lore raw

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

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

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

PM: EM: Fix NULL pointer dereference when perf domain ID is not found

dev_energymodel_nl_get_perf_domains_doit() calls em_perf_domain_get_by_id() but does not check the return value before passing it to __em_nl_get_pd_size(). When a caller supplies a non-existent perf domain ID, em_perf_domain_get_by_id() returns NULL, and __em_nl_get_pd_size() immediately dereferences pd->cpus (struct offset 0x30), causing a NULL pointer dereference.

The sister handler dev_energymodel_nl_get_perf_table_doit() already handles this correctly via __em_nl_get_pd_table_id(), which returns NULL and causes the caller to return -EINVAL. Add the same NULL check in the get-perf-domains do handler.

[ rjw: Subject and changelog edits ]

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

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

	Issue introduced in 6.19 with commit 380ff27af25e49e2cb2ff8fd0ecd7c95be2976ee and fixed in 6.19.12 with commit ab09b9a1e3b02ff62c5aebe3b12b0cb4cb4ea8ab
	Issue introduced in 6.19 with commit 380ff27af25e49e2cb2ff8fd0ecd7c95be2976ee and fixed in 7.0 with commit 9badc2a84e688be1275bb740942d5f6f51746908

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-31744

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/em_netlink.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/ab09b9a1e3b02ff62c5aebe3b12b0cb4cb4ea8ab
	https://git.kernel.org/stable/c/9badc2a84e688be1275bb740942d5f6f51746908