Skip to contentSkip to conversation

CVE-2026-23068: spi: spi-sprd-adi: Fix double free in probe error path

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Feb 4

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: spi-sprd-adi: Fix double free in probe error path

The driver currently uses spi_alloc_host() to allocate the controller but registers it using devm_spi_register_controller().

If devm_register_restart_handler() fails, the code jumps to the put_ctlr label and calls spi_controller_put(). However, since the controller was registered via a devm function, the device core will automatically call spi_controller_put() again when the probe fails. This results in a double-free of the spi_controller structure.

Fix this by switching to devm_spi_alloc_host() and removing the manual spi_controller_put() call.

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

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

	Issue introduced in 4.17 with commit ac1775012058e13ef1522938e27f5973d9e3f053 and fixed in 6.6.122 with commit 417cdfd9b9f986e95bfcb1d68eb443e6e0a15f8c
	Issue introduced in 4.17 with commit ac1775012058e13ef1522938e27f5973d9e3f053 and fixed in 6.12.68 with commit 346775f2b4cf839177e8e86b94aa180a06dc15b0
	Issue introduced in 4.17 with commit ac1775012058e13ef1522938e27f5973d9e3f053 and fixed in 6.18.8 with commit f6d6b3f172df118db582fe5ec43ae223a55d99cf
	Issue introduced in 4.17 with commit ac1775012058e13ef1522938e27f5973d9e3f053 and fixed in 6.19-rc7 with commit 383d4f5cffcc8df930d95b06518a9d25a6d74aac

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

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-sprd-adi.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/417cdfd9b9f986e95bfcb1d68eb443e6e0a15f8c
	https://git.kernel.org/stable/c/346775f2b4cf839177e8e86b94aa180a06dc15b0
	https://git.kernel.org/stable/c/f6d6b3f172df118db582fe5ec43ae223a55d99cf
	https://git.kernel.org/stable/c/383d4f5cffcc8df930d95b06518a9d25a6d74aac