# CVE-2025-21781: batman-adv: fix panic during interface removal

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; 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:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.30% (percentile 15, 2026-11-26)
- **Published:** 2025-02-27T02:18:24.013Z
- **Modified:** 2026-06-17T08:44:15.803Z

## Who should check

- Anyone running Linux \>= c833484e5f3872a38fe232c663586069d5ad9645, \< 167422a07096a6006599067c8b55884064fa0b72; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< ce3f1545bf8fa28bd05ec113679e8e6cd23af577; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< f0a16c6c79768180333f3e41ce63f32730e3c3af; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< 7eb5dd201695645af071592a50026eb780081a72; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< 072b2787321903287a126c148e8db87dd7ef96fe; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< 2c3fb7df4cc6d043f70d4a8a10f8b915bbfb75e7; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< 522b1596ea19e327853804da2de60aeb9c5d6f42; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< ccb7276a6d26d6f8416e315b43b45e15ee7f29e2
- Anyone running Linux 4.6

## Description

In the Linux kernel, the following vulnerability has been resolved:

batman-adv: fix panic during interface removal

Reference counting is used to ensure that
batadv\_hardif\_neigh\_node and batadv\_hard\_iface
are not freed before/during
batadv\_v\_elp\_throughput\_metric\_update work is
finished.

But there isn't a guarantee that the hard if will
remain associated with a soft interface up until
the work is finished.

This fixes a crash triggered by reboot that looks
like this:

Call trace:
 batadv\_v\_mesh\_free+0xd0/0x4dc \[batman\_adv\]
 batadv\_v\_elp\_throughput\_metric\_update+0x1c/0xa4
 process\_one\_work+0x178/0x398
 worker\_thread+0x2e8/0x4d0
 kthread+0xd8/0xdc
 ret\_from\_fork+0x10/0x20

(the batadv\_v\_mesh\_free call is misleading,
and does not actually happen)

I was able to make the issue happen more reliably
by changing hardif\_neigh-\>bat\_v.metric\_work work
to be delayed work. This allowed me to track down
and confirm the fix.

\[sven@narfation.org: prevent entering batadv\_v\_elp\_get\_throughput without
 soft\_iface\]

## Affected and fixed versions

- Linux: \>= c833484e5f3872a38fe232c663586069d5ad9645, \< 167422a07096a6006599067c8b55884064fa0b72; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< ce3f1545bf8fa28bd05ec113679e8e6cd23af577; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< f0a16c6c79768180333f3e41ce63f32730e3c3af; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< 7eb5dd201695645af071592a50026eb780081a72; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< 072b2787321903287a126c148e8db87dd7ef96fe; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< 2c3fb7df4cc6d043f70d4a8a10f8b915bbfb75e7; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< 522b1596ea19e327853804da2de60aeb9c5d6f42; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< ccb7276a6d26d6f8416e315b43b45e15ee7f29e2 (cvelist)
- Linux: 4.6 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-21781.md
Affected: Linux >= c833484e5f3872a38fe232c663586069d5ad9645, < 167422a07096a6006599067c8b55884064fa0b72; >= c833484e5f3872a38fe232c663586069d5ad9645, < ce3f1545bf8fa28bd05ec113679e8e6cd23af577; >= c833484e5f3872a38fe232c663586069d5ad9645, < f0a16c6c79768180333f3e41ce63f32730e3c3af; >= c833484e5f3872a38fe232c…
Fixed in: Linux 167422a07096a6006599067c8b55884064fa0b72, Linux 7eb5dd201695645af071592a50026eb780081a72, Linux 072b2787321903287a126c148e8db87dd7ef96fe, Linux 2c3fb7df4cc6d043f70d4a8a10f8b915bbfb75e7, Linux 522b1596ea19e327853804da2de60aeb9c5d6f42

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-2025-21781 being exploited?

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

### How serious is CVE-2025-21781?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-21781?

Linux \>= c833484e5f3872a38fe232c663586069d5ad9645, \< 167422a07096a6006599067c8b55884064fa0b72; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< ce3f1545bf8fa28bd05ec113679e8e6cd23af577; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< f0a16c6c79768180333f3e41ce63f32730e3c3af; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< 7eb5dd201695645af071592a50026eb780081a72; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< 072b2787321903287a126c148e8db87dd7ef96fe; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< 2c3fb7df4cc6d043f70d4a8a10f8b915bbfb75e7; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< 522b1596ea19e327853804da2de60aeb9c5d6f42; \>= c833484e5f3872a38fe232c663586069d5ad9645, \< ccb7276a6d26d6f8416e315b43b45e15ee7f29e2; Linux 4.6.

### Is there a fix for CVE-2025-21781?

Yes. Fixed in Linux 167422a07096a6006599067c8b55884064fa0b72, Linux 7eb5dd201695645af071592a50026eb780081a72, Linux 072b2787321903287a126c148e8db87dd7ef96fe, Linux 2c3fb7df4cc6d043f70d4a8a10f8b915bbfb75e7, Linux 522b1596ea19e327853804da2de60aeb9c5d6f42. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2025-21781?

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/167422a07096a6006599067c8b55884064fa0b72>
- patch: <https://git.kernel.org/stable/c/ce3f1545bf8fa28bd05ec113679e8e6cd23af577>
- patch: <https://git.kernel.org/stable/c/f0a16c6c79768180333f3e41ce63f32730e3c3af>
- patch: <https://git.kernel.org/stable/c/7eb5dd201695645af071592a50026eb780081a72>
- patch: <https://git.kernel.org/stable/c/072b2787321903287a126c148e8db87dd7ef96fe>
- patch: <https://git.kernel.org/stable/c/2c3fb7df4cc6d043f70d4a8a10f8b915bbfb75e7>
- patch: <https://git.kernel.org/stable/c/522b1596ea19e327853804da2de60aeb9c5d6f42>
- patch: <https://git.kernel.org/stable/c/ccb7276a6d26d6f8416e315b43b45e15ee7f29e2>
- other: <https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html>

## 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-2025-21781>

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