CVE-2021-47482 json
net: batman-adv: fix error handling
published 2024-05-22 2 y ago modified 2026-06-17 4 mo ago also EUVD-2021-34487
- cvss
- 5.3
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.7%
- EPSS 0.7% chance of exploitation in 30 days, percentile 54%
- public exploits
- 0
- none known
Summary
In the Linux kernel, the following vulnerability has been resolved:
net: batman-adv: fix error handling
Syzbot reported ODEBUG warning in batadv_nc_mesh_free(). The problem was in wrong error handling in batadv_mesh_init().
Before this patch batadv_mesh_init() was calling batadv_mesh_free() in case of any batadv_*_init() calls failure. This approach may work well, when there is some kind of indicator, which can tell which parts of batadv are initialized; but there isn't any.
All written above lead to cleaning up uninitialized fields. Even if we hide ODEBUG warning by initializing bat_priv->nc.work, syzbot was able to hit GPF in batadv_nc_purge_paths(), because hash pointer in still NULL. [1]
To fix these bugs we can unwind batadv_*_init() calls one by one. It is good approach for 2 reasons: 1) It fixes bugs on error handling path 2) It improves the performance, since we won't call unneeded batadv_*_free() functions.
So, this patch makes all batadv_*_init() clean up all allocated memory before returning with an error to no call correspoing batadv_*_free() and open-codes batadv_mesh_free() with proper order to avoid touching uninitialized fields.
Patch / fix
- Linux Linux 4.4.293, 4.9.289, 4.14.254, 4.19.215, 5.4.157, 5.10.77, 5.14.16, 5.15
- linux kernel 6f68cd634856
- linux Debian 14, Debian 13, Debian 12 5.15.3-1
debian advisories DEBIAN-CVE-2021-47482
- linux Ubuntu 18.04 LTS 4.15.0-167.175
- linux Ubuntu 20.04 LTS 5.4.0-92.103
- linux-aws Ubuntu 18.04 LTS 4.15.0-1119.127
- linux-aws Ubuntu 20.04 LTS 5.4.0-1061.64
- linux-gcp Ubuntu 20.04 LTS 5.4.0-1059.63
- linux-ibm Ubuntu 20.04 LTS 5.4.0-1010.11
- linux-kvm Ubuntu 18.04 LTS 4.15.0-1106.108
- linux-kvm Ubuntu 20.04 LTS 5.4.0-1051.53
ubuntu advisories UBUNTU-CVE-2021-47482
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- dtb-aarch64 openSUSE Leap 15.5 5.14.21-150500.55.68.1
- kernel-64kb SLE Module for Basesystem 15 SP5, openSUSE Leap 15.5 5.14.21-150500.55.68.1
- kernel-syms SLE Module for Development Tools 15 SP5, openSUSE Leap 15.5 5.14.21-150500.55.68.1
- kernel-obs-qa openSUSE Leap 15.5 5.14.21-150500.55.68.1
- kernel-source SLE Module for Development Tools 15 SP5, SLE Module for Basesystem 15 SP5, openSUSE Leap 15.5 5.14.21-150500.55.68.1
- kernel-default SLE Workstation Extension 15 SP5, SLE Module for Legacy 15 SP5, SLE Module for Basesystem 15 SP5 +4 more 5.14.21-150500.55.68.1
- kernel-kvmsmall openSUSE Leap 15.5 5.14.21-150500.55.68.1
- kernel-zfcpdump SLE Module for Basesystem 15 SP5, openSUSE Leap 15.5 5.14.21-150500.55.68.1
suse advisories SUSE-SU-2024:2190-1SUSE-SU-2024:2189-1SUSE-SU-2024:2185-1SUSE-SU-2024:2183-1SUSE-SU-2024:2019-1SUSE-SU-2024:2011-1
- git.kernel.org/stable/c/0c6b199f09be489c48622537a550787fc80aea73 commit
- git.kernel.org/stable/c/07533f1a673ce1126d0a72ef1e4b5eaaa3dd6d20 commit
- git.kernel.org/stable/c/e50f957652190b5a88a8ebce7e5ab14ebd0d3f00 commit
- git.kernel.org/stable/c/fbf150b16a3635634b7dfb7f229d8fcd643c6c51 commit
- git.kernel.org/stable/c/6422e8471890273994fe8cc6d452b0dcd2c9483e commit
- git.kernel.org/stable/c/b0a2cd38553c77928ef1646ed1518486b1e70ae8 commit
- git.kernel.org/stable/c/a8f7359259dd5923adc6129284fdad12fc5db347 commit
- git.kernel.org/stable/c/6f68cd634856f8ca93bafd623ba5357e0f648c68 commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-47482 updated cvss 5.5
kernel: net: batman-adv: fix error handling
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 2 y ago
Exploit prediction
0.74% chance of exploitation in the next 30 days, higher than 54% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CISA ADP | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H |
| CNA | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H |
Affected products
- Linux Linux
- linux kernel
Classification
- Weakness
-
- CWE-544 Missing Standardized Error Handling Mechanism
- Technology feeds
References
-
git.kernel.org
/stable/c/0c6b199f09be489c48622537a550787fc80aea73
patch
-
git.kernel.org
/stable/c/07533f1a673ce1126d0a72ef1e4b5eaaa3dd6d20
patch
-
git.kernel.org
/stable/c/e50f957652190b5a88a8ebce7e5ab14ebd0d3f00
patch
-
git.kernel.org
/stable/c/fbf150b16a3635634b7dfb7f229d8fcd643c6c51
patch
-
git.kernel.org
/stable/c/6422e8471890273994fe8cc6d452b0dcd2c9483e
patch
-
git.kernel.org
/stable/c/b0a2cd38553c77928ef1646ed1518486b1e70ae8
patch
-
git.kernel.org
/stable/c/a8f7359259dd5923adc6129284fdad12fc5db347
patch
-
git.kernel.org
/stable/c/6f68cd634856f8ca93bafd623ba5357e0f648c68
patch
Sources
- CVE List CVE-2021-47482
- NVD CVE-2021-47482
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.