CVE-2021-47012

Severity CVSS v4.0:
Pending analysis
Type:
CWE-416 Use After Free
Publication date:
28/02/2024
Last modified:
09/12/2024

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> RDMA/siw: Fix a use after free in siw_alloc_mr<br /> <br /> Our code analyzer reported a UAF.<br /> <br /> In siw_alloc_mr(), it calls siw_mr_add_mem(mr,..). In the implementation of<br /> siw_mr_add_mem(), mem is assigned to mr-&gt;mem and then mem is freed via<br /> kfree(mem) if xa_alloc_cyclic() failed. Here, mr-&gt;mem still point to a<br /> freed object. After, the execution continue up to the err_out branch of<br /> siw_alloc_mr, and the freed mr-&gt;mem is used in siw_mr_drop_mem(mr).<br /> <br /> My patch moves "mr-&gt;mem = mem" behind the if (xa_alloc_cyclic(..)

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.3 (including) 5.4.119 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.5 (including) 5.10.37 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.11 (including) 5.11.21 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.12 (including) 5.12.4 (excluding)