CVE-2021-47483: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: regmap: Fix possible double-free in regcache_rbtree_exit() In regcache_rbtree_insert_to_block(), when 'present' realloc failed, the 'blk' which is supposed to assign to 'rbnode->block' will be freed, so 'rbnode->block' points a freed memory, in the error handling path of regcache_rbtree_init(), 'rbnode->block' will be freed again in regcache_rbtree_exit(), KASAN will report double-free as follows: BUG: KASAN: double-free or invalid-free in kfree+0xce/0x390 Call Trace: slab_free_freelist_hook+0x10d/0x240 kfree+0xce/0x390 regcache_rbtree_exit+0x15d/0x1a0 regcache_rbtree_init+0x224/0x2c0 regcache_init+0x88d/0x1310 __regmap_init+0x3151/0x4a80 __devm_regmap_init+0x7d/0x100 madera_spi_probe+0x10f/0x333 [madera_spi] spi_probe+0x183/0x210 really_probe+0x285/0xc30 To fix this, moving up the assignment of rbnode->block to immediately after the reallocation has succeeded so that the data structure stays valid even if the second reallocation fails.
AI Analysis
Technical Summary
CVE-2021-47483 is a vulnerability identified in the Linux kernel's regmap subsystem, specifically within the regcache_rbtree component. The flaw arises from improper error handling in the regcache_rbtree_insert_to_block() function. When a memory reallocation ('realloc') operation fails during the insertion process, the code erroneously frees a memory block ('blk') that is still referenced by the red-black tree node's 'block' pointer (rbnode->block). This leads to a use-after-free condition where 'rbnode->block' points to freed memory. Subsequently, during cleanup in regcache_rbtree_exit(), the same memory is freed again, causing a double-free error. This double-free is detected by Kernel Address Sanitizer (KASAN) as an invalid free operation. The root cause is the delayed assignment of the 'rbnode->block' pointer until after the second reallocation succeeds, which allows the pointer to reference freed memory if the second realloc fails. The fix involves moving the assignment of 'rbnode->block' immediately after the first successful reallocation, ensuring the data structure remains consistent even if subsequent reallocations fail. This vulnerability affects Linux kernel versions identified by the commit hash 3f4ff561bc88b074d5e868dde4012d89cbb06c87 and likely other versions containing the same regmap implementation. No known exploits have been reported in the wild as of the publication date (May 22, 2024).
Potential Impact
The vulnerability can lead to kernel memory corruption due to double-free conditions, which may cause system instability, crashes (kernel panics), or potentially enable privilege escalation or arbitrary code execution within the kernel context if exploited. For European organizations, especially those running Linux-based infrastructure such as servers, embedded devices, or IoT systems that utilize the regmap subsystem (commonly used for managing register maps in hardware devices), this vulnerability could compromise system reliability and security. Exploitation could disrupt critical services, lead to denial of service, or be leveraged as part of a multi-stage attack to gain elevated privileges. Given the Linux kernel's widespread use across European industries including telecommunications, finance, manufacturing, and government, the impact could be significant if attackers develop reliable exploits. However, the absence of known exploits and the technical complexity of triggering this specific double-free condition may limit immediate risk. Nonetheless, unpatched systems remain vulnerable to future exploitation attempts.
Mitigation Recommendations
European organizations should promptly apply the official Linux kernel patches that address CVE-2021-47483 once available from their Linux distribution vendors. System administrators should: 1) Identify all Linux systems running affected kernel versions, particularly those with hardware components using the regmap subsystem (e.g., SPI devices, embedded controllers). 2) Prioritize patching of critical infrastructure and devices exposed to untrusted inputs or networks. 3) Employ kernel hardening techniques such as Kernel Address Sanitizer (KASAN) in testing environments to detect similar memory corruption issues proactively. 4) Monitor kernel logs for signs of memory corruption or double-free errors that could indicate exploitation attempts. 5) Limit access to systems with vulnerable kernels, especially restricting unprivileged user access that could trigger the vulnerability. 6) Engage with Linux distribution security advisories and subscribe to vulnerability notifications to stay informed about updates and exploit developments. 7) For embedded or IoT devices, coordinate with hardware vendors to ensure firmware updates include the kernel fix. These steps go beyond generic advice by focusing on the specific subsystem and error conditions involved in this vulnerability.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Spain, Sweden, Finland
CVE-2021-47483: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: regmap: Fix possible double-free in regcache_rbtree_exit() In regcache_rbtree_insert_to_block(), when 'present' realloc failed, the 'blk' which is supposed to assign to 'rbnode->block' will be freed, so 'rbnode->block' points a freed memory, in the error handling path of regcache_rbtree_init(), 'rbnode->block' will be freed again in regcache_rbtree_exit(), KASAN will report double-free as follows: BUG: KASAN: double-free or invalid-free in kfree+0xce/0x390 Call Trace: slab_free_freelist_hook+0x10d/0x240 kfree+0xce/0x390 regcache_rbtree_exit+0x15d/0x1a0 regcache_rbtree_init+0x224/0x2c0 regcache_init+0x88d/0x1310 __regmap_init+0x3151/0x4a80 __devm_regmap_init+0x7d/0x100 madera_spi_probe+0x10f/0x333 [madera_spi] spi_probe+0x183/0x210 really_probe+0x285/0xc30 To fix this, moving up the assignment of rbnode->block to immediately after the reallocation has succeeded so that the data structure stays valid even if the second reallocation fails.
AI-Powered Analysis
Technical Analysis
CVE-2021-47483 is a vulnerability identified in the Linux kernel's regmap subsystem, specifically within the regcache_rbtree component. The flaw arises from improper error handling in the regcache_rbtree_insert_to_block() function. When a memory reallocation ('realloc') operation fails during the insertion process, the code erroneously frees a memory block ('blk') that is still referenced by the red-black tree node's 'block' pointer (rbnode->block). This leads to a use-after-free condition where 'rbnode->block' points to freed memory. Subsequently, during cleanup in regcache_rbtree_exit(), the same memory is freed again, causing a double-free error. This double-free is detected by Kernel Address Sanitizer (KASAN) as an invalid free operation. The root cause is the delayed assignment of the 'rbnode->block' pointer until after the second reallocation succeeds, which allows the pointer to reference freed memory if the second realloc fails. The fix involves moving the assignment of 'rbnode->block' immediately after the first successful reallocation, ensuring the data structure remains consistent even if subsequent reallocations fail. This vulnerability affects Linux kernel versions identified by the commit hash 3f4ff561bc88b074d5e868dde4012d89cbb06c87 and likely other versions containing the same regmap implementation. No known exploits have been reported in the wild as of the publication date (May 22, 2024).
Potential Impact
The vulnerability can lead to kernel memory corruption due to double-free conditions, which may cause system instability, crashes (kernel panics), or potentially enable privilege escalation or arbitrary code execution within the kernel context if exploited. For European organizations, especially those running Linux-based infrastructure such as servers, embedded devices, or IoT systems that utilize the regmap subsystem (commonly used for managing register maps in hardware devices), this vulnerability could compromise system reliability and security. Exploitation could disrupt critical services, lead to denial of service, or be leveraged as part of a multi-stage attack to gain elevated privileges. Given the Linux kernel's widespread use across European industries including telecommunications, finance, manufacturing, and government, the impact could be significant if attackers develop reliable exploits. However, the absence of known exploits and the technical complexity of triggering this specific double-free condition may limit immediate risk. Nonetheless, unpatched systems remain vulnerable to future exploitation attempts.
Mitigation Recommendations
European organizations should promptly apply the official Linux kernel patches that address CVE-2021-47483 once available from their Linux distribution vendors. System administrators should: 1) Identify all Linux systems running affected kernel versions, particularly those with hardware components using the regmap subsystem (e.g., SPI devices, embedded controllers). 2) Prioritize patching of critical infrastructure and devices exposed to untrusted inputs or networks. 3) Employ kernel hardening techniques such as Kernel Address Sanitizer (KASAN) in testing environments to detect similar memory corruption issues proactively. 4) Monitor kernel logs for signs of memory corruption or double-free errors that could indicate exploitation attempts. 5) Limit access to systems with vulnerable kernels, especially restricting unprivileged user access that could trigger the vulnerability. 6) Engage with Linux distribution security advisories and subscribe to vulnerability notifications to stay informed about updates and exploit developments. 7) For embedded or IoT devices, coordinate with hardware vendors to ensure firmware updates include the kernel fix. These steps go beyond generic advice by focusing on the specific subsystem and error conditions involved in this vulnerability.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- Linux
- Date Reserved
- 2024-05-22T06:20:56.200Z
- Cisa Enriched
- true
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682d9833c4522896dcbe925a
Added to database: 5/21/2025, 9:09:07 AM
Last enriched: 6/30/2025, 1:39:58 PM
Last updated: 8/6/2025, 12:47:12 AM
Views: 11
Related Threats
CVE-2025-43735: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Liferay Portal
MediumCVE-2025-40770: CWE-300: Channel Accessible by Non-Endpoint in Siemens SINEC Traffic Analyzer
HighCVE-2025-40769: CWE-1164: Irrelevant Code in Siemens SINEC Traffic Analyzer
HighCVE-2025-40768: CWE-200: Exposure of Sensitive Information to an Unauthorized Actor in Siemens SINEC Traffic Analyzer
HighCVE-2025-40767: CWE-250: Execution with Unnecessary Privileges in Siemens SINEC Traffic Analyzer
HighActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.