{"id":"CVE-2021-47482","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: batman-adv: fix error handling\n\nSyzbot reported ODEBUG warning in batadv_nc_mesh_free(). The problem was\nin wrong error handling in batadv_mesh_init().\n\nBefore this patch batadv_mesh_init() was calling batadv_mesh_free() in case\nof any batadv_*_init() calls failure. This approach may work well, when\nthere is some kind of indicator, which can tell which parts of batadv are\ninitialized; but there isn't any.\n\nAll written above lead to cleaning up uninitialized fields. Even if we hide\nODEBUG warning by initializing bat_priv-\u003enc.work, syzbot was able to hit\nGPF in batadv_nc_purge_paths(), because hash pointer in still NULL. [1]\n\nTo fix these bugs we can unwind batadv_*_init() calls one by one.\nIt is good approach for 2 reasons: 1) It fixes bugs on error handling\npath 2) It improves the performance, since we won't call unneeded\nbatadv_*_free() functions.\n\nSo, this patch makes all batadv_*_init() clean up all allocated memory\nbefore returning with an error to no call correspoing batadv_*_free()\nand open-codes batadv_mesh_free() with proper order to avoid touching\nuninitialized fields.","modified":"2026-03-15T22:43:14.691217Z","published":"2024-05-22T09:15:10.150Z","related":["SUSE-SU-2024:2008-1","SUSE-SU-2024:2010-1","SUSE-SU-2024:2011-1","SUSE-SU-2024:2019-1","SUSE-SU-2024:2183-1","SUSE-SU-2024:2185-1","SUSE-SU-2024:2189-1","SUSE-SU-2024:2190-1"],"references":[{"type":"FIX","url":"https://git.kernel.org/stable/c/07533f1a673ce1126d0a72ef1e4b5eaaa3dd6d20"},{"type":"FIX","url":"https://git.kernel.org/stable/c/0c6b199f09be489c48622537a550787fc80aea73"},{"type":"FIX","url":"https://git.kernel.org/stable/c/6422e8471890273994fe8cc6d452b0dcd2c9483e"},{"type":"FIX","url":"https://git.kernel.org/stable/c/6f68cd634856f8ca93bafd623ba5357e0f648c68"},{"type":"FIX","url":"https://git.kernel.org/stable/c/a8f7359259dd5923adc6129284fdad12fc5db347"},{"type":"FIX","url":"https://git.kernel.org/stable/c/b0a2cd38553c77928ef1646ed1518486b1e70ae8"},{"type":"FIX","url":"https://git.kernel.org/stable/c/e50f957652190b5a88a8ebce7e5ab14ebd0d3f00"},{"type":"FIX","url":"https://git.kernel.org/stable/c/fbf150b16a3635634b7dfb7f229d8fcd643c6c51"}],"affected":[{"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-47482.json","unresolved_ranges":[{"events":[{"introduced":"2.6.38"},{"fixed":"4.4.293"}]},{"events":[{"introduced":"4.5"},{"fixed":"4.9.289"}]},{"events":[{"introduced":"4.10"},{"fixed":"4.14.254"}]},{"events":[{"introduced":"4.15"},{"fixed":"4.19.215"}]},{"events":[{"introduced":"4.20"},{"fixed":"5.4.157"}]},{"events":[{"introduced":"5.5"},{"fixed":"5.10.77"}]},{"events":[{"introduced":"5.11"},{"fixed":"5.14.16"}]},{"events":[{"introduced":"0"},{"last_affected":"5.15-rc1"}]},{"events":[{"introduced":"0"},{"last_affected":"5.15-rc2"}]},{"events":[{"introduced":"0"},{"last_affected":"5.15-rc3"}]},{"events":[{"introduced":"0"},{"last_affected":"5.15-rc4"}]},{"events":[{"introduced":"0"},{"last_affected":"5.15-rc5"}]},{"events":[{"introduced":"0"},{"last_affected":"5.15-rc6"}]},{"events":[{"introduced":"0"},{"last_affected":"5.15-rc7"}]}]}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H"}]}