CVE-2021-46959
Linux Kernel vulnerability analysis and mitigation

Overview

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).

Technical details

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).

Impact

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).

Exploitability

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).

Mitigation and workarounds

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).

Additional resources


SourceThis report was generated using AI

Related Linux Kernel vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-68426MEDIUM4.7
  • Linux Kernel logoLinux Kernel
  • kernel-rt-debug-modules-core
NoYesAug 10, 2026
CVE-2026-68425MEDIUM4.3
  • Linux Kernel logoLinux Kernel
  • kernel
NoYesAug 10, 2026
CVE-2026-68422LOW3.3
  • Linux Kernel logoLinux Kernel
  • linux
NoYesAug 10, 2026
CVE-2026-68428NONEN/A
  • Linux Kernel logoLinux Kernel
  • kernel6.12
NoYesAug 10, 2026
CVE-2026-68421NONEN/A
  • Linux Kernel logoLinux Kernel
  • kernel6.12
NoYesAug 10, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management