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

- Priority: **Routine**
- Reason: Not severe (CVSS 5.5, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2025-02-27 · Modified: 2026-05-11
- Aliases: UBUNTU-CVE-2025-21781, DEBIAN-CVE-2025-21781
- Record: https://cvemate.com/vulnerability/CVE-2025-21781 · JSON: https://cvemate.com/vulnerability/CVE-2025-21781/json

## Description

```text
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]
```

## Signals

- CVSS: 5.5 medium (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- EPSS: 0.225%, percentile 14.07%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 140)

- debian linux (Debian): \< 6.1.129-1 \| \< 6.12.16-1
- ubuntu linux (Ubuntu): All versions (No fix recorded) \| \< 5.4.0-216.236 \| \< 5.15.0-140.150 \| \< 6.8.0-78.78
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded) \| \< 5.4.0-1146.156 \| \< 5.15.0-1084.91 \| \< 6.8.0-1035.37
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): \< 5.15.0-1084.91~20.04.1
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): \< 5.4.0-1146.156~18.04.1
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.8 (Ubuntu): \< 6.8.0-1035.37~22.04.1
- ubuntu linux-aws-fips (Ubuntu): All versions (No fix recorded) \| \< 5.4.0-1146.156+fips1 \| \< 5.15.0-1084.91+fips1
- ubuntu linux-aws-hwe (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure (Ubuntu): All versions (No fix recorded) \| \< 5.4.0-1151.158 \| \< 5.15.0-1089.98 \| \< 6.8.0-1034.39
- ubuntu linux-azure-4.15 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)

## References (first 20 of 53)

- <https://git.kernel.org/stable/c/167422a07096a6006599067c8b55884064fa0b72>
- <https://git.kernel.org/stable/c/ce3f1545bf8fa28bd05ec113679e8e6cd23af577>
- <https://git.kernel.org/stable/c/f0a16c6c79768180333f3e41ce63f32730e3c3af>
- <https://git.kernel.org/stable/c/7eb5dd201695645af071592a50026eb780081a72>
- <https://git.kernel.org/stable/c/072b2787321903287a126c148e8db87dd7ef96fe>
- <https://git.kernel.org/stable/c/2c3fb7df4cc6d043f70d4a8a10f8b915bbfb75e7>
- <https://git.kernel.org/stable/c/522b1596ea19e327853804da2de60aeb9c5d6f42>
- <https://git.kernel.org/stable/c/ccb7276a6d26d6f8416e315b43b45e15ee7f29e2>
- <https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html>
- <https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html>
- <https://ubuntu.com/security/CVE-2025-21781>
- <https://www.cve.org/CVERecord?id=CVE-2025-21781>
- <https://git.kernel.org/linus/ccb7276a6d26d6f8416e315b43b45e15ee7f29e2>
- <https://ubuntu.com/security/notices/USN-7510-1>
- <https://ubuntu.com/security/notices/USN-7510-2>
- <https://ubuntu.com/security/notices/USN-7511-1>
- <https://ubuntu.com/security/notices/USN-7511-2>
- <https://ubuntu.com/security/notices/USN-7512-1>
- <https://ubuntu.com/security/notices/USN-7516-1>
- <https://ubuntu.com/security/notices/USN-7516-2>

---

Data as of 2026-12-05T05:32:55.257Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
