Skip to contentSkip to conversation

CVE-2026-31389: spi: fix use-after-free on controller registration failure

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Apr 3

lore
Share & tools
lore
#0 lore raw

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

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

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

spi: fix use-after-free on controller registration failure

Make sure to deregister from driver core also in the unlikely event that per-cpu statistics allocation fails during controller registration to avoid use-after-free (of driver resources) and unclocked register accesses.

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

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

	Issue introduced in 6.0 with commit 6598b91b5ac32bc756d7c3000a31f775d4ead1c4 and fixed in 6.1.167 with commit 0e23f50086da7d0b183dfeac26021acfcdee086b
	Issue introduced in 6.0 with commit 6598b91b5ac32bc756d7c3000a31f775d4ead1c4 and fixed in 6.6.130 with commit 6bbd385b30c7fb6c7ee0669e9ada91490938c051
	Issue introduced in 6.0 with commit 6598b91b5ac32bc756d7c3000a31f775d4ead1c4 and fixed in 6.12.78 with commit afe27c1f43aa57530011f419be6ddf71306565d2
	Issue introduced in 6.0 with commit 6598b91b5ac32bc756d7c3000a31f775d4ead1c4 and fixed in 6.18.20 with commit 80f3e8cd2b4ad355b2ad2024cf423f6d183404f7
	Issue introduced in 6.0 with commit 6598b91b5ac32bc756d7c3000a31f775d4ead1c4 and fixed in 6.19.10 with commit 23b51bad2eb8787aa74324cfccefb258515ae5ba
	Issue introduced in 6.0 with commit 6598b91b5ac32bc756d7c3000a31f775d4ead1c4 and fixed in 7.0-rc5 with commit 8634e05b08ead636e926022f4a98416e13440df9

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

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/spi/spi.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/0e23f50086da7d0b183dfeac26021acfcdee086b
	https://git.kernel.org/stable/c/6bbd385b30c7fb6c7ee0669e9ada91490938c051
	https://git.kernel.org/stable/c/afe27c1f43aa57530011f419be6ddf71306565d2
	https://git.kernel.org/stable/c/80f3e8cd2b4ad355b2ad2024cf423f6d183404f7
	https://git.kernel.org/stable/c/23b51bad2eb8787aa74324cfccefb258515ae5ba
	https://git.kernel.org/stable/c/8634e05b08ead636e926022f4a98416e13440df9