{"id":"CVE-2021-47012","aliases":["CVE-2021-47012"],"related":[],"kind":"vulnerability","state":"published","title":"RDMA/siw: Fix a use after free in siw_alloc_mr","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nRDMA/siw: Fix a use after free in siw_alloc_mr\n\nOur code analyzer reported a UAF.\n\nIn siw_alloc_mr(), it calls siw_mr_add_mem(mr,..). In the implementation of\nsiw_mr_add_mem(), mem is assigned to mr->mem and then mem is freed via\nkfree(mem) if xa_alloc_cyclic() failed. Here, mr->mem still point to a\nfreed object. After, the execution continue up to the err_out branch of\nsiw_alloc_mr, and the freed mr->mem is used in siw_mr_drop_mem(mr).\n\nMy patch moves \"mr->mem = mem\" behind the if (xa_alloc_cyclic(..)<0) {}\nsection, to avoid the uaf.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nRDMA/siw: Fix a use after free in siw_alloc_mr\n\nOur code analyzer reported a UAF.\n\nIn siw_alloc_mr(), it calls siw_mr_add_mem(mr,..). In the implementation of\nsiw_mr_add_mem(), mem is assigned to mr->mem and then mem is freed via\nkfree(mem) if xa_alloc_cyclic() failed. Here, mr->mem still point to a\nfreed object. After, the execution continue up to the err_out branch of\nsiw_alloc_mr, and the freed mr->mem is used in siw_mr_drop_mem(mr).\n\nMy patch moves \"mr->mem = mem\" behind the if (xa_alloc_cyclic(..)<0) {}\nsection, to avoid the uaf.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux se ha resuelto la siguiente vulnerabilidad: RDMA/siw: Corrige un use after free en siw_alloc_mr Nuestro analizador de código informó un UAF. En siw_alloc_mr(), llama a siw_mr_add_mem(mr,..). En la implementación de siw_mr_add_mem(), mem se asigna a mr-&gt;mem y luego mem se libera mediante kfree(mem) si xa_alloc_ciclic() falla. Aquí, mr-&gt;mem todavía apunta a un objeto liberado. Después, la ejecución continúa hasta la rama err_out de siw_alloc_mr, y el mr-&gt;mem liberado se usa en siw_mr_drop_mem(mr). Mi parche mueve \"mr-&gt;mem = mem\" detrás de la sección if (xa_alloc_ciclic(..)&lt;0) {}, para evitar el uaf.","source":"nvd"}],"published":"2024-02-28T08:13:30.284Z","modified":"2026-08-05T08:45:33.281Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"type":"git","introduced":"2251334dcac9eb337575d8767e2a6a7e81848f7f","fixed":"30b9e92d0b5e5d5dc1101ab856c17009537cbca4","status":"affected"},{"type":"git","introduced":"2251334dcac9eb337575d8767e2a6a7e81848f7f","fixed":"608a4b90ece039940e9425ee2b39c8beff27e00c","status":"affected"},{"type":"git","introduced":"2251334dcac9eb337575d8767e2a6a7e81848f7f","fixed":"3e22b88e02c194f6c80867abfef5cc09383461f4","status":"affected"},{"type":"git","introduced":"2251334dcac9eb337575d8767e2a6a7e81848f7f","fixed":"ad9ce7188432650469a6c7625bf479f5ed0b6155","status":"affected"},{"type":"git","introduced":"2251334dcac9eb337575d8767e2a6a7e81848f7f","fixed":"3093ee182f01689b89e9f8797b321603e5de4f63","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.3","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.3","status":"unaffected"},{"type":"semver","introduced":"5.4.119","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.37","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.11.21","lastAffected":"5.11.*","status":"unaffected"},{"type":"semver","introduced":"5.12.4","lastAffected":"5.12.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"5.13","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.3","fixed":"5.4.119"},{"status":"affected","introduced":"5.5","fixed":"5.10.37"},{"status":"affected","introduced":"5.11","fixed":"5.11.21"},{"status":"affected","introduced":"5.12","fixed":"5.12.4"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/30b9e92d0b5e5d5dc1101ab856c17009537cbca4","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/608a4b90ece039940e9425ee2b39c8beff27e00c","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3e22b88e02c194f6c80867abfef5cc09383461f4","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ad9ce7188432650469a6c7625bf479f5ed0b6155","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3093ee182f01689b89e9f8797b321603e5de4f63","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-02-28T20:34:17.324Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-47012","url":"https://www.cve.org/CVERecord?id=CVE-2021-47012","licence":"CVE Terms of Use","modified":"2026-08-05T08:45:33.281Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-47012","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-47012","licence":"Public domain","modified":"2026-08-04T10:16:41.407Z"}],"updatedAt":"2026-11-25T22:58:08.616Z","epss":{"score":0.0027,"percentile":0.20608,"date":"2026-12-01T12:00:22.000Z"}}