CVE-2026-45996: spi: imx: fix use-after-free on unbind
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
spi: imx: fix use-after-free on unbind
The SPI subsystem frees the controller and any subsystem allocated driver data as part of deregistration (unless the allocation is device managed).
Take another reference before deregistering the controller so that the driver data is not freed until the driver is done with it.
The Linux kernel CVE team has assigned CVE-2026-45996 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.19 with commit 307c897db762d1e0feee9477276b08f6deca4a5b and fixed in 6.6.140 with commit f99165ef067723221472ce1aff632bc74f562643 Issue introduced in 5.19 with commit 307c897db762d1e0feee9477276b08f6deca4a5b and fixed in 6.12.86 with commit 385a330083f8dd47c15b02e9a83aef9234a37003 Issue introduced in 5.19 with commit 307c897db762d1e0feee9477276b08f6deca4a5b and fixed in 6.18.27 with commit 132e47030b0b5e398e0da6c59df5a5dae9b52cff Issue introduced in 5.19 with commit 307c897db762d1e0feee9477276b08f6deca4a5b and fixed in 7.0.4 with commit aa9025a498036b6012769f7af36d421385386c17 Issue introduced in 5.19 with commit 307c897db762d1e0feee9477276b08f6deca4a5b and fixed in 7.1-rc1 with commit 1c78c2002380a1fe31bfb01a3d5f29809e55a096
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-45996
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-imx.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/f99165ef067723221472ce1aff632bc74f562643 https://git.kernel.org/stable/c/385a330083f8dd47c15b02e9a83aef9234a37003 https://git.kernel.org/stable/c/132e47030b0b5e398e0da6c59df5a5dae9b52cff https://git.kernel.org/stable/c/aa9025a498036b6012769f7af36d421385386c17 https://git.kernel.org/stable/c/1c78c2002380a1fe31bfb01a3d5f29809e55a096