CVE-2021-47482
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
22/05/2024
Last modified:
02/04/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
net: batman-adv: fix error handling<br />
<br />
Syzbot reported ODEBUG warning in batadv_nc_mesh_free(). The problem was<br />
in wrong error handling in batadv_mesh_init().<br />
<br />
Before this patch batadv_mesh_init() was calling batadv_mesh_free() in case<br />
of any batadv_*_init() calls failure. This approach may work well, when<br />
there is some kind of indicator, which can tell which parts of batadv are<br />
initialized; but there isn&#39;t any.<br />
<br />
All written above lead to cleaning up uninitialized fields. Even if we hide<br />
ODEBUG warning by initializing bat_priv->nc.work, syzbot was able to hit<br />
GPF in batadv_nc_purge_paths(), because hash pointer in still NULL. [1]<br />
<br />
To fix these bugs we can unwind batadv_*_init() calls one by one.<br />
It is good approach for 2 reasons: 1) It fixes bugs on error handling<br />
path 2) It improves the performance, since we won&#39;t call unneeded<br />
batadv_*_free() functions.<br />
<br />
So, this patch makes all batadv_*_init() clean up all allocated memory<br />
before returning with an error to no call correspoing batadv_*_free()<br />
and open-codes batadv_mesh_free() with proper order to avoid touching<br />
uninitialized fields.
Impact
Base Score 3.x
5.30
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 2.6.38 (including) | 4.4.293 (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/07533f1a673ce1126d0a72ef1e4b5eaaa3dd6d20
- https://git.kernel.org/stable/c/0c6b199f09be489c48622537a550787fc80aea73
- https://git.kernel.org/stable/c/6422e8471890273994fe8cc6d452b0dcd2c9483e
- https://git.kernel.org/stable/c/6f68cd634856f8ca93bafd623ba5357e0f648c68
- https://git.kernel.org/stable/c/a8f7359259dd5923adc6129284fdad12fc5db347
- https://git.kernel.org/stable/c/b0a2cd38553c77928ef1646ed1518486b1e70ae8
- https://git.kernel.org/stable/c/e50f957652190b5a88a8ebce7e5ab14ebd0d3f00
- https://git.kernel.org/stable/c/fbf150b16a3635634b7dfb7f229d8fcd643c6c51
- https://git.kernel.org/stable/c/07533f1a673ce1126d0a72ef1e4b5eaaa3dd6d20
- https://git.kernel.org/stable/c/0c6b199f09be489c48622537a550787fc80aea73
- https://git.kernel.org/stable/c/6422e8471890273994fe8cc6d452b0dcd2c9483e
- https://git.kernel.org/stable/c/6f68cd634856f8ca93bafd623ba5357e0f648c68
- https://git.kernel.org/stable/c/a8f7359259dd5923adc6129284fdad12fc5db347
- https://git.kernel.org/stable/c/b0a2cd38553c77928ef1646ed1518486b1e70ae8
- https://git.kernel.org/stable/c/e50f957652190b5a88a8ebce7e5ab14ebd0d3f00
- https://git.kernel.org/stable/c/fbf150b16a3635634b7dfb7f229d8fcd643c6c51



