CVE-2021-47483
Severity CVSS v4.0:
Pending analysis
Type:
CWE-415
Double Free
Publication date:
22/05/2024
Last modified:
06/01/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
regmap: Fix possible double-free in regcache_rbtree_exit()<br />
<br />
In regcache_rbtree_insert_to_block(), when &#39;present&#39; realloc failed,<br />
the &#39;blk&#39; which is supposed to assign to &#39;rbnode->block&#39; will be freed,<br />
so &#39;rbnode->block&#39; points a freed memory, in the error handling path of<br />
regcache_rbtree_init(), &#39;rbnode->block&#39; will be freed again in<br />
regcache_rbtree_exit(), KASAN will report double-free as follows:<br />
<br />
BUG: KASAN: double-free or invalid-free in kfree+0xce/0x390<br />
Call Trace:<br />
slab_free_freelist_hook+0x10d/0x240<br />
kfree+0xce/0x390<br />
regcache_rbtree_exit+0x15d/0x1a0<br />
regcache_rbtree_init+0x224/0x2c0<br />
regcache_init+0x88d/0x1310<br />
__regmap_init+0x3151/0x4a80<br />
__devm_regmap_init+0x7d/0x100<br />
madera_spi_probe+0x10f/0x333 [madera_spi]<br />
spi_probe+0x183/0x210<br />
really_probe+0x285/0xc30<br />
<br />
To fix this, moving up the assignment of rbnode->block to immediately after<br />
the reallocation has succeeded so that the data structure stays valid even<br />
if the second reallocation fails.
Impact
Base Score 3.x
7.80
Severity 3.x
HIGH
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 3.12 (including) | 4.4.291 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.5 (including) | 4.9.289 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.10 (including) | 4.14.254 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.15 (including) | 4.19.215 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.20 (including) | 5.4.157 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.5 (including) | 5.10.77 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.11 (including) | 5.14.16 (excluding) |
| cpe:2.3:o:linux:linux_kernel:5.15:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.15:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.15:rc3:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.15:rc4:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.15:rc5:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.15:rc6:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.15:rc7:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/1cead23c1c0bc766dacb900a3b0269f651ad596f
- https://git.kernel.org/stable/c/36e911a16b377bde0ad91a8c679069d0d310b1a6
- https://git.kernel.org/stable/c/3dae1a4eced3ee733d7222e69b8a55caf2d61091
- https://git.kernel.org/stable/c/50cc1462a668dc62949a1127388bc3af785ce047
- https://git.kernel.org/stable/c/55e6d8037805b3400096d621091dfbf713f97e83
- https://git.kernel.org/stable/c/758ced2c3878ff789801e6fee808e185c5cf08d6
- https://git.kernel.org/stable/c/e72dce9afbdbfa70d9b44f5908a50ff6c4858999
- https://git.kernel.org/stable/c/fc081477b47dfc3a6cb50a96087fc29674013fc2
- https://git.kernel.org/stable/c/1cead23c1c0bc766dacb900a3b0269f651ad596f
- https://git.kernel.org/stable/c/36e911a16b377bde0ad91a8c679069d0d310b1a6
- https://git.kernel.org/stable/c/3dae1a4eced3ee733d7222e69b8a55caf2d61091
- https://git.kernel.org/stable/c/50cc1462a668dc62949a1127388bc3af785ce047
- https://git.kernel.org/stable/c/55e6d8037805b3400096d621091dfbf713f97e83
- https://git.kernel.org/stable/c/758ced2c3878ff789801e6fee808e185c5cf08d6
- https://git.kernel.org/stable/c/e72dce9afbdbfa70d9b44f5908a50ff6c4858999
- https://git.kernel.org/stable/c/fc081477b47dfc3a6cb50a96087fc29674013fc2



