Linux Kernel up to 5.12.3 lib/refcount.c spi_unregister_controller use after free

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
6.5$0-$5k0.00

Summaryinfo

A vulnerability was found in Linux Kernel up to 5.12.3. It has been rated as problematic. Affected is the function spi_unregister_controller in the library lib/refcount.c. The manipulation leads to use after free. This vulnerability is listed as CVE-2021-46959. There is no available exploit. Upgrading the affected component is advised.

Detailsinfo

A vulnerability was found in Linux Kernel up to 5.12.3 (Operating System) and classified as problematic. This issue affects the function spi_unregister_controller in the library lib/refcount.c. The manipulation with an unknown input leads to a use after free vulnerability. Using CWE to declare the problem leads to CWE-416. Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. The impact remains unknown. The summary by CVE is:

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_{master,slave}() 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 [] (refcount_warn_saturate) from [] (kobject_put+0x90/0x98) [] (kobject_put) from [] (put_device+0x20/0x24) r4:b6700140 [] (put_device) from [] (devm_spi_release_controller+0x3c/0x40) [] (devm_spi_release_controller) from [] (release_nodes+0x84/0xc4) r5:b6700180 r4:b6700100 [] (release_nodes) from [] (devres_release_all+0x5c/0x60) r8:b1638c54 r7:b117ad94 r6:b1638c10 r5:b117ad94 r4:b163dc10 [] (devres_release_all) from [] (__device_release_driver+0x144/0x1ec) r5:b117ad94 r4:b163dc10 [] (__device_release_driver) from [] (device_driver_detach+0x84/0xa0) r9:00000000 r8:00000000 r7:b117ad94 r6:b163dc54 r5:b1638c10 r4:b163dc10 [] (device_driver_detach) from [] (unbind_store+0xe4/0xf8) Instead, determine the devm allocation state as a flag on the controller which is guaranteed to be stable during cleanup.

The weakness was presented 03/01/2024. The advisory is shared at git.kernel.org. The identification of this vulnerability is CVE-2021-46959 since 02/27/2024. Technical details are known, but no exploit is available.

The vulnerability scanner Nessus provides a plugin with the ID 235726 (Ubuntu 16.04 LTS : Linux kernel vulnerabilities (USN-7506-1)), which helps to determine the existence of the flaw in a target environment.

Upgrading to version 4.4.271, 4.9.271, 4.14.233, 4.19.191, 5.4.119, 5.10.37, 5.11.21, 5.12.4 or 5.13 eliminates this vulnerability. Applying the patch 62bb2c7f2411/8bf96425c90f/8e029707f50a/28a5529068c5/001c8e83646a/c7fabe372a90/cee78aa24578/8735248ebb91/794aaf01444d is able to eliminate this problem. The bugfix is ready for download at git.kernel.org. The best possible mitigation is suggested to be upgrading to the latest version.

The vulnerability is also documented in the vulnerability database at Tenable (235726). Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Productinfo

Type

Vendor

Name

Version

License

Website

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 6.6
VulDB Meta Temp Score: 6.5

VulDB Base Score: 5.5
VulDB Temp Score: 5.3
VulDB Vector: 🔍
VulDB Reliability: 🔍

NVD Base Score: 7.8
NVD Vector: 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍

Exploitinginfo

Class: Use after free
CWE: CWE-416 / CWE-119
CAPEC: 🔍
ATT&CK: 🔍

Physical: Partially
Local: Yes
Remote: Partially

Availability: 🔍
Status: Not defined

EPSS Score: 🔍
EPSS Percentile: 🔍

Price Prediction: 🔍
Current Price Estimation: 🔍

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Nessus ID: 235726
Nessus Name: Ubuntu 16.04 LTS : Linux kernel vulnerabilities (USN-7506-1)

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Upgrade
Status: 🔍

0-Day Time: 🔍

Upgrade: Kernel 4.4.271/4.9.271/4.14.233/4.19.191/5.4.119/5.10.37/5.11.21/5.12.4/5.13
Patch: 62bb2c7f2411/8bf96425c90f/8e029707f50a/28a5529068c5/001c8e83646a/c7fabe372a90/cee78aa24578/8735248ebb91/794aaf01444d

Timelineinfo

02/27/2024 🔍
03/01/2024 +3 days 🔍
03/01/2024 +0 days 🔍
05/13/2025 +438 days 🔍

Sourcesinfo

Vendor: kernel.org

Advisory: git.kernel.org
Status: Confirmed

CVE: CVE-2021-46959 (🔍)
GCVE (CVE): GCVE-0-2021-46959
GCVE (VulDB): GCVE-100-255353

Entryinfo

Created: 03/01/2024 07:30
Updated: 05/13/2025 05:13
Changes: 03/01/2024 07:30 (43), 12/11/2024 01:57 (27), 05/13/2025 05:13 (2)
Complete: 🔍
Cache ID: 216::103

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Do you want to use VulDB in your project?

Use the official API to access entries easily!