CVE-2023-53225: spi: imx: Don't skip cleanup in remove's error path
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
spi: imx: Don't skip cleanup in remove's error path
Returning early in a platform driver's remove callback is wrong. In this case the dma resources are not released in the error path. this is never retried later and so this is a permanent leak. To fix this, only skip hardware disabling if waking the device fails.
The Linux kernel CVE team has assigned CVE-2023-53225 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.16 with commit d593574aff0ab846136190b1729c151c736727ec and fixed in 5.10.180 with commit aa93a46f998a9069368026ac52bba96868c59157 Issue introduced in 4.16 with commit d593574aff0ab846136190b1729c151c736727ec and fixed in 5.15.111 with commit f90822ad63d11301e425311dac0c8e12ca1737b8 Issue introduced in 4.16 with commit d593574aff0ab846136190b1729c151c736727ec and fixed in 6.1.28 with commit 6d16305a1535873e0a8a8ae92ea2d9106ec2d7df Issue introduced in 4.16 with commit d593574aff0ab846136190b1729c151c736727ec and fixed in 6.2.15 with commit 57a463226638f1ceabbb029cbd21b0c94640f1b5 Issue introduced in 4.16 with commit d593574aff0ab846136190b1729c151c736727ec and fixed in 6.3.2 with commit b64cb3f085fed296103c91f0db6acad30a021b36 Issue introduced in 4.16 with commit d593574aff0ab846136190b1729c151c736727ec and fixed in 6.4 with commit 11951c9e3f364d7ae3b568a0e52c8335d43066b5 Issue introduced in 3.16.57 with commit fc58a98f1c98b22d31c53913cca38d5c43807cb4 Issue introduced in 3.18.94 with commit 28ae79a518421348abfc2a2dffd6a6b6e3699476 Issue introduced in 4.1.50 with commit b6aaaaed67b170a9841f0f598cd45ccbfe76e15e Issue introduced in 4.4.115 with commit f84a8d446a16379df5844bc2bd50f0b7431a4718 Issue introduced in 4.9.80 with commit 1333c3e996eb799286ee2ef2c01752da45bf926f Issue introduced in 4.14.17 with commit cfd96cbd607ab5d63a33cd63673221f4d572ea8c Issue introduced in 4.15.1 with commit bac4bf53ca7c65d6c06808aab70c6caa0b9c78b9
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-2023-53225
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/aa93a46f998a9069368026ac52bba96868c59157 https://git.kernel.org/stable/c/f90822ad63d11301e425311dac0c8e12ca1737b8 https://git.kernel.org/stable/c/6d16305a1535873e0a8a8ae92ea2d9106ec2d7df https://git.kernel.org/stable/c/57a463226638f1ceabbb029cbd21b0c94640f1b5 https://git.kernel.org/stable/c/b64cb3f085fed296103c91f0db6acad30a021b36 https://git.kernel.org/stable/c/11951c9e3f364d7ae3b568a0e52c8335d43066b5