CVE-2021-46959 Information
Description
In the Linux kernel the following vulnerability has been resolved:
spi: Fix use-after-free with devm_spi_alloc_
We can’t rely on the contents of the devres list during spi_unregister_controller() as the list is already torn down at the time we perform devres_find() for devm_spi_release_controller. This causes devices registered with devm_spi_alloc_masterslave() to be mistakenly identified as legacy non-devm managed devices and have their reference counters decremented below 0.
————[ cut here ]————
WARNING: CPU: 1 PID: 660 at lib/refcount.c:28 refcount_warn_saturate+0x108/0x174
[
Instead determine the devm allocation state as a flag on the controller which is guaranteed to be stable during cleanup.
Reference
https://git.kernel.org/stable/c/62bb2c7f2411a0045c24831f11ecacfc35610815 https://git.kernel.org/stable/c/8bf96425c90f5c1dcf3b7b9df568019a1d4b8a0e https://git.kernel.org/stable/c/8e029707f50a82c53172359c686b2536ab54e58c https://git.kernel.org/stable/c/28a5529068c51cdf0295ab1e11a99a3a909a03e4 https://git.kernel.org/stable/c/001c8e83646ad3b847b18f6ac55a54367d917d74 https://git.kernel.org/stable/c/c7fabe372a9031acd00498bc718ce27c253abfd1 https://git.kernel.org/stable/c/cee78aa24578edac8cf00513dca618c0acc17cd7 https://git.kernel.org/stable/c/8735248ebb918d25427965f0db07939ed0473ec6 https://git.kernel.org/stable/c/794aaf01444d4e765e2b067cba01cc69c1c68ed9
Share on: