
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2021-46959 is a use-after-free vulnerability in the Linux kernel's SPI (Serial Peripheral Interface) subsystem. The issue affects devices registered with devm_spi_alloc_{master,slave}() functions, which are mistakenly identified as legacy, non-devm managed devices and have their reference counters decremented below 0. This vulnerability affects multiple versions of the Linux kernel, including versions from 4.4.248 to 4.4.271, 4.9.248 to 4.9.271, 4.14.212 to 4.14.233, 4.19.163 to 4.19.191, 5.4.80 to 5.4.119, 5.10 to 5.10.37, 5.11 to 5.11.21, and 5.12 to 5.12.4 (NVD).
The vulnerability occurs during spi_unregister_controller() execution, where the code cannot rely on the contents of the devres list as it is already torn down at the time devres_find() is called for devm_spi_release_controller. The issue stems from improper handling of device resource management, specifically in the SPI controller allocation and deallocation process. The vulnerability has been assigned a CVSS v3.1 score with the following metrics: AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H, and is classified as CWE-416 (Kernel Git).
The vulnerability can lead to a use-after-free condition, which may result in system crashes, memory corruption, and potential privilege escalation. When triggered, the issue generates kernel warnings and can cause reference counter decrements below 0, potentially compromising system stability (Kernel Git).
The vulnerability requires local access with low privileges to exploit. The attack complexity is low, and no user interaction is required. The exploit can be triggered through the SPI subsystem's device management functions (NVD).
The issue has been fixed by implementing a flag (devm_allocated) on the controller which is guaranteed to be stable during cleanup. The fix involves determining the devm allocation state through this flag rather than relying on the devres list contents. The patch has been merged into the Linux kernel, and users should upgrade to patched versions of their respective kernel branches (Kernel Git).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."