# CVE-2021-47482: net: batman-adv: fix error handling

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.3
- **CVSS:** 5.3 (v3.1, CNA) `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: High; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, login needed
- **EPSS:** 1.25% (percentile 69, 2026-11-26)
- **CWE:** CWE-544
- **Published:** 2024-05-22T08:19:34.174Z
- **Modified:** 2026-06-17T04:17:35.843Z

## Who should check

- Anyone running Linux \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< 0c6b199f09be489c48622537a550787fc80aea73; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< 07533f1a673ce1126d0a72ef1e4b5eaaa3dd6d20; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< e50f957652190b5a88a8ebce7e5ab14ebd0d3f00; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< fbf150b16a3635634b7dfb7f229d8fcd643c6c51; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< 6422e8471890273994fe8cc6d452b0dcd2c9483e; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< b0a2cd38553c77928ef1646ed1518486b1e70ae8; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< a8f7359259dd5923adc6129284fdad12fc5db347; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< 6f68cd634856f8ca93bafd623ba5357e0f648c68
- Anyone running Linux 2.6.38

## Description

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.

## Affected and fixed versions

- Linux: \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< 0c6b199f09be489c48622537a550787fc80aea73; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< 07533f1a673ce1126d0a72ef1e4b5eaaa3dd6d20; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< e50f957652190b5a88a8ebce7e5ab14ebd0d3f00; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< fbf150b16a3635634b7dfb7f229d8fcd643c6c51; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< 6422e8471890273994fe8cc6d452b0dcd2c9483e; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< b0a2cd38553c77928ef1646ed1518486b1e70ae8; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< a8f7359259dd5923adc6129284fdad12fc5db347; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< 6f68cd634856f8ca93bafd623ba5357e0f648c68 (cvelist)
- Linux: 2.6.38 (cvelist)

## Mitigation

- Upgrade Linux to 6f68cd634856f8ca93bafd623ba5357e0f648c68 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-47482. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-47482.md
Affected: Linux >= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, < 0c6b199f09be489c48622537a550787fc80aea73; >= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, < 07533f1a673ce1126d0a72ef1e4b5eaaa3dd6d20; >= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, < e50f957652190b5a88a8ebce7e5ab14ebd0d3f00; >= c6c8fea29769d998d94fcec…
Fixed in: Linux 0c6b199f09be489c48622537a550787fc80aea73, Linux 07533f1a673ce1126d0a72ef1e4b5eaaa3dd6d20, Linux 6422e8471890273994fe8cc6d452b0dcd2c9483e, Linux 6f68cd634856f8ca93bafd623ba5357e0f648c68

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-47482 being exploited?

There is no confirmed exploitation: CVE-2021-47482 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.25% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-47482?

Medium: CVSS 5.3 (v3.1, scored by CNA). Remote, login needed. The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2021-47482?

Linux \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< 0c6b199f09be489c48622537a550787fc80aea73; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< 07533f1a673ce1126d0a72ef1e4b5eaaa3dd6d20; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< e50f957652190b5a88a8ebce7e5ab14ebd0d3f00; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< fbf150b16a3635634b7dfb7f229d8fcd643c6c51; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< 6422e8471890273994fe8cc6d452b0dcd2c9483e; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< b0a2cd38553c77928ef1646ed1518486b1e70ae8; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< a8f7359259dd5923adc6129284fdad12fc5db347; \>= c6c8fea29769d998d94fcec9b9f14d4b52b349d3, \< 6f68cd634856f8ca93bafd623ba5357e0f648c68; Linux 2.6.38.

### Is there a fix for CVE-2021-47482?

Yes. Fixed in Linux 0c6b199f09be489c48622537a550787fc80aea73, Linux 07533f1a673ce1126d0a72ef1e4b5eaaa3dd6d20, Linux 6422e8471890273994fe8cc6d452b0dcd2c9483e, Linux 6f68cd634856f8ca93bafd623ba5357e0f648c68. Upgrade Linux to 6f68cd634856f8ca93bafd623ba5357e0f648c68 or later.

### How do I check if I'm affected by CVE-2021-47482?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/0c6b199f09be489c48622537a550787fc80aea73>
- patch: <https://git.kernel.org/stable/c/07533f1a673ce1126d0a72ef1e4b5eaaa3dd6d20>
- patch: <https://git.kernel.org/stable/c/e50f957652190b5a88a8ebce7e5ab14ebd0d3f00>
- patch: <https://git.kernel.org/stable/c/fbf150b16a3635634b7dfb7f229d8fcd643c6c51>
- patch: <https://git.kernel.org/stable/c/6422e8471890273994fe8cc6d452b0dcd2c9483e>
- patch: <https://git.kernel.org/stable/c/b0a2cd38553c77928ef1646ed1518486b1e70ae8>
- patch: <https://git.kernel.org/stable/c/a8f7359259dd5923adc6129284fdad12fc5db347>
- patch: <https://git.kernel.org/stable/c/6f68cd634856f8ca93bafd623ba5357e0f648c68>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-47482>

HTML: <https://flawdb.com/CVE-2021-47482> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-47482>
