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 siwallocmr
Our code analyzer reported a UAF.
In siwallocmr(), it calls siwmraddmem(mr,..). In the implementation of siwmraddmem(), mem is assigned to mr->mem and then mem is freed via kfree(mem) if xaalloccyclic() failed. Here, mr->mem still point to a freed object. After, the execution continue up to the errout branch of siwallocmr, and the freed mr->mem is used in siwmrdropmem(mr).
My patch moves "mr->mem = mem" behind the if (xaalloccyclic(..)<0) {} section, to avoid the uaf.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2021-47012?
CVE-2021-47012 has been classified with a moderate severity due to a use-after-free vulnerability in the Linux kernel.
How do I fix CVE-2021-47012?
To fix CVE-2021-47012, upgrade your Linux kernel to a version that includes the patch addressing this vulnerability.
Which versions of the Linux kernel are affected by CVE-2021-47012?
CVE-2021-47012 affects Linux kernel versions between 5.3 and 5.4.119, 5.5 and 5.10.37, 5.11 and 5.11.21, and 5.12 and 5.12.4.
What impact does CVE-2021-47012 have on system security?
Exploiting CVE-2021-47012 could potentially allow an attacker to execute arbitrary code or crash the system.
Is CVE-2021-47012 a remote code execution vulnerability?
CVE-2021-47012 is not specifically classified as a remote code execution vulnerability, but it does pose risks related to memory management.