CVE-2026-23431: spi: amlogic-spisg: Fix memory leak in aml_spisg_probe()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
spi: amlogic-spisg: Fix memory leak in aml_spisg_probe()
In aml_spisg_probe(), ctlr is allocated by spi_alloc_target()/spi_alloc_host(), but fails to call spi_controller_put() in several error paths. This leads to a memory leak whenever the driver fails to probe after the initial allocation.
Convert to use devm_spi_alloc_host()/devm_spi_alloc_target() to fix the memory leak.
The Linux kernel CVE team has assigned CVE-2026-23431 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.17 with commit cef9991e04aed3305c61c392e880f6e01a0c2ea4 and fixed in 6.18.20 with commit bec21d97c968a4806939eb2946df49ea6c341bde Issue introduced in 6.17 with commit cef9991e04aed3305c61c392e880f6e01a0c2ea4 and fixed in 6.19.10 with commit 8e28a01b69f7ea8df7ceb15470cfe643b2828f4f Issue introduced in 6.17 with commit cef9991e04aed3305c61c392e880f6e01a0c2ea4 and fixed in 7.0-rc5 with commit b8db9552997924b750e727a625a30eaa4603bbb9
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-23431
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-amlogic-spisg.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/bec21d97c968a4806939eb2946df49ea6c341bde https://git.kernel.org/stable/c/8e28a01b69f7ea8df7ceb15470cfe643b2828f4f https://git.kernel.org/stable/c/b8db9552997924b750e727a625a30eaa4603bbb9