Skip to content
Fencer Intel
medium 5.3

CVE-2021-47482 json

net: batman-adv: fix error handling

published 2y ago modified 4mo 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

  • kernel CBL-Mariner 2.0 5.15.176.3-1

azure linux advisories AZL-43306

Azure Linux vulnerability data, Copyright (c) Microsoft Corporation, from https://github.com/microsoft/AzureLinuxVulnerabilityData via OSV, under the MIT licence; changed: normalised to fixed package versions per release. MIT

Is CVE-2021-47482 in your stack? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

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 more
    not 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
2y ago

Exploit prediction

0.74% chance of exploitation in the next 30 days, higher than 54% of all scored CVEs (FIRST EPSS, 2026-11-09).

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

Sources

Fencer Intel 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.