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&amp;#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-&gt;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&amp;#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.

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:*:*:*:*:*:*