Skip to contentSkip to conversation

CVE-2026-99527: spmi: Fix potential use-after-free by grabbing of_node reference

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Nov 19

lore
Share & tools
lore
#0 lore raw

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

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

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

spmi: Fix potential use-after-free by grabbing of_node reference

As noticed by Sashiko during a review run of an unrelated patch, in of_spmi_register_devices(), for_each_available_child_of_node() is used to loop through children, and to also assign a node to a newly created SPMI child device.

Problem is that the refcount is dropped at every iteration so, in the specific case of DT overlays, a use-after-free may occur when an overlay is dynamically unloaded!

To resolve this, increase the of_node refcount when assigning (in function of_spmi_register_devices) and release the reference in spmi_device_remove().

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

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

	Issue introduced in 6.14 with commit bc32bbd0401170853b479645002df52f849f48fe and fixed in 6.18.61 with commit b5e5d035abd1b49ecc9c85320fd6dfcc57ef9c79
	Issue introduced in 6.14 with commit bc32bbd0401170853b479645002df52f849f48fe and fixed in 7.3.2 with commit 5653608781a660485d5e9be48a1d06025c4b97cf
	Issue introduced in 6.14 with commit bc32bbd0401170853b479645002df52f849f48fe and fixed in 7.4-rc1 with commit f7aa9de4f2b197cdd704cdc476901b68ee128433

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

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/spmi/spmi.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/b5e5d035abd1b49ecc9c85320fd6dfcc57ef9c79
	https://git.kernel.org/stable/c/5653608781a660485d5e9be48a1d06025c4b97cf
	https://git.kernel.org/stable/c/f7aa9de4f2b197cdd704cdc476901b68ee128433