CVE-2021-47012: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: RDMA/siw: Fix a use after free in siw_alloc_mr Our code analyzer reported a UAF. In siw_alloc_mr(), it calls siw_mr_add_mem(mr,..). In the implementation of siw_mr_add_mem(), mem is assigned to mr->mem and then mem is freed via kfree(mem) if xa_alloc_cyclic() failed. Here, mr->mem still point to a freed object. After, the execution continue up to the err_out branch of siw_alloc_mr, and the freed mr->mem is used in siw_mr_drop_mem(mr). My patch moves "mr->mem = mem" behind the if (xa_alloc_cyclic(..)<0) {} section, to avoid the uaf.
AI Analysis
Technical Summary
CVE-2021-47012 is a use-after-free (UAF) vulnerability identified in the Linux kernel's RDMA (Remote Direct Memory Access) subsystem, specifically within the SoftiWARP (siw) driver component. The vulnerability arises in the function siw_alloc_mr(), which is responsible for allocating memory regions (MR) for RDMA operations. During execution, siw_alloc_mr() calls siw_mr_add_mem(mr, ...), where a memory object 'mem' is assigned to the mr->mem pointer. However, if the call to xa_alloc_cyclic() within siw_mr_add_mem() fails, the memory object 'mem' is freed using kfree(mem), but mr->mem still points to this now-freed memory. Subsequently, the code continues to the error handling branch err_out in siw_alloc_mr(), where the freed mr->mem pointer is dereferenced in siw_mr_drop_mem(mr), leading to a use-after-free condition. This UAF can cause undefined behavior including potential kernel crashes or exploitation opportunities. The patch corrects this by moving the assignment mr->mem = mem to occur only after the successful completion of xa_alloc_cyclic(), ensuring mr->mem never points to freed memory. This vulnerability affects specific Linux kernel versions identified by commit hashes and was published on 2024-02-28. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to systems utilizing RDMA capabilities with the SoftiWARP driver, often found in high-performance computing environments, data centers, and enterprise servers running Linux kernels with affected versions. Exploitation could lead to kernel crashes (denial of service) or potentially privilege escalation if an attacker crafts inputs to trigger the UAF, compromising system integrity and availability. Confidentiality impact is lower unless combined with other vulnerabilities. The disruption of critical infrastructure or enterprise services relying on RDMA could have operational and financial consequences. Given the kernel-level nature, successful exploitation could undermine trust in affected systems and require urgent patching to maintain security posture.
Mitigation Recommendations
European organizations should prioritize updating Linux kernels to versions that include the patch for CVE-2021-47012. Specifically, they should verify kernel versions against the affected commit hashes and apply vendor-supplied patches or kernel updates promptly. For environments where immediate patching is not feasible, disabling the SoftiWARP RDMA driver or restricting RDMA usage to trusted users and processes can reduce exposure. Monitoring kernel logs for unusual crashes or memory errors related to RDMA operations can help detect attempted exploitation. Additionally, employing kernel hardening techniques such as Kernel Address Space Layout Randomization (KASLR) and enabling kernel lockdown features can raise exploitation difficulty. Regular vulnerability scanning and inventory of Linux kernel versions across infrastructure will aid in identifying at-risk systems.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Denmark
CVE-2021-47012: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: RDMA/siw: Fix a use after free in siw_alloc_mr Our code analyzer reported a UAF. In siw_alloc_mr(), it calls siw_mr_add_mem(mr,..). In the implementation of siw_mr_add_mem(), mem is assigned to mr->mem and then mem is freed via kfree(mem) if xa_alloc_cyclic() failed. Here, mr->mem still point to a freed object. After, the execution continue up to the err_out branch of siw_alloc_mr, and the freed mr->mem is used in siw_mr_drop_mem(mr). My patch moves "mr->mem = mem" behind the if (xa_alloc_cyclic(..)<0) {} section, to avoid the uaf.
AI-Powered Analysis
Technical Analysis
CVE-2021-47012 is a use-after-free (UAF) vulnerability identified in the Linux kernel's RDMA (Remote Direct Memory Access) subsystem, specifically within the SoftiWARP (siw) driver component. The vulnerability arises in the function siw_alloc_mr(), which is responsible for allocating memory regions (MR) for RDMA operations. During execution, siw_alloc_mr() calls siw_mr_add_mem(mr, ...), where a memory object 'mem' is assigned to the mr->mem pointer. However, if the call to xa_alloc_cyclic() within siw_mr_add_mem() fails, the memory object 'mem' is freed using kfree(mem), but mr->mem still points to this now-freed memory. Subsequently, the code continues to the error handling branch err_out in siw_alloc_mr(), where the freed mr->mem pointer is dereferenced in siw_mr_drop_mem(mr), leading to a use-after-free condition. This UAF can cause undefined behavior including potential kernel crashes or exploitation opportunities. The patch corrects this by moving the assignment mr->mem = mem to occur only after the successful completion of xa_alloc_cyclic(), ensuring mr->mem never points to freed memory. This vulnerability affects specific Linux kernel versions identified by commit hashes and was published on 2024-02-28. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to systems utilizing RDMA capabilities with the SoftiWARP driver, often found in high-performance computing environments, data centers, and enterprise servers running Linux kernels with affected versions. Exploitation could lead to kernel crashes (denial of service) or potentially privilege escalation if an attacker crafts inputs to trigger the UAF, compromising system integrity and availability. Confidentiality impact is lower unless combined with other vulnerabilities. The disruption of critical infrastructure or enterprise services relying on RDMA could have operational and financial consequences. Given the kernel-level nature, successful exploitation could undermine trust in affected systems and require urgent patching to maintain security posture.
Mitigation Recommendations
European organizations should prioritize updating Linux kernels to versions that include the patch for CVE-2021-47012. Specifically, they should verify kernel versions against the affected commit hashes and apply vendor-supplied patches or kernel updates promptly. For environments where immediate patching is not feasible, disabling the SoftiWARP RDMA driver or restricting RDMA usage to trusted users and processes can reduce exposure. Monitoring kernel logs for unusual crashes or memory errors related to RDMA operations can help detect attempted exploitation. Additionally, employing kernel hardening techniques such as Kernel Address Space Layout Randomization (KASLR) and enabling kernel lockdown features can raise exploitation difficulty. Regular vulnerability scanning and inventory of Linux kernel versions across infrastructure will aid in identifying at-risk systems.
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-02-27T18:42:55.953Z
- Cisa Enriched
- true
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682d9834c4522896dcbe9a54
Added to database: 5/21/2025, 9:09:08 AM
Last enriched: 6/30/2025, 7:13:00 PM
Last updated: 8/14/2025, 8:55:55 AM
Views: 17
Related Threats
CVE-2025-53948: CWE-415 Double Free in Santesoft Sante PACS Server
HighCVE-2025-52584: CWE-122 Heap-based Buffer Overflow in Ashlar-Vellum Cobalt
HighCVE-2025-46269: CWE-122 Heap-based Buffer Overflow in Ashlar-Vellum Cobalt
HighCVE-2025-54862: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Santesoft Sante PACS Server
MediumCVE-2025-54759: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Santesoft Sante PACS Server
MediumActions
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.