CVE-2021-47012: RDMA/siw: Fix a use after free in siw_alloc_mr
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.
Security readout for executives and security teams
Plain-English summary
This is a Linux kernel memory safety flaw in the RDMA/siw component. A failed allocation path can leave a pointer aimed at freed memory and later reuse it. The sources do not provide CVSS, impact detail, or evidence of real-world exploitation.
Executive priority
Handle through normal kernel patch governance, with faster review for systems using RDMA/siw. There is no supplied evidence of exploitation or severity scoring, but kernel memory safety defects can carry operational risk when reachable.
Technical view
In siw_alloc_mr(), siw_mr_add_mem() assigned mem to mr->mem before xa_alloc_cyclic() succeeded. If xa_alloc_cyclic() failed, mem was freed while mr->mem still referenced it, and siw_mr_drop_mem() later used that freed pointer. The fix moves the assignment after the failure check.
Likely exposure
Exposure is most relevant to Linux systems running affected kernel versions with RDMA/siw code present or used. The bundle lists Linux kernel affected ranges around 5.3 through fixes in 5.4.119, 5.10.37, 5.11.21, and 5.12.4, but distro backports need local confirmation.
Exploitation context
The bundle marks KEV as false and gives no cited evidence of active exploitation. The issue was reported by a code analyzer. Practical exploitability and impact are not described in the supplied sources, so this should be treated as an exposure-management item rather than confirmed active attack activity.
Researcher notes
The evidence is limited to the CVE record and upstream stable commits. Focus validation on whether the RDMA/siw memory-registration path exists in deployed kernels and whether the fix moving mr->mem assignment after xa_alloc_cyclic() success is present.
Mitigation direction
Check Linux or distribution advisories for CVE-2021-47012 coverage.
Update to a kernel containing the referenced stable RDMA/siw fixes.
Prioritize systems where RDMA/siw is enabled, loaded, or business-critical.
Confirm distro backports rather than relying only on upstream version numbers.
Validation and detection
Inventory kernel versions across Linux servers and appliances.
Identify systems with RDMA/siw support enabled or in use.
Verify the installed kernel includes one of the referenced stable fixes or vendor backport.
Run standard regression checks for RDMA-dependent workloads after updating.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2021-47012 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.