CVE-2025-21781
NoneCVSS
—
EPSS
0.2%
Published
Feb 27, 2025
CISA due date
—
Cloudanix analysis
A bug in the Linux kernel's wireless mesh networking code can make the system crash when network interfaces are removed or during reboot.
- Exploitation
- Local Privilege
- Attacker needs
- Local User
- Complexity
- Moderate
- Impact
- Denial Of Service
- Component
- OS kernel
- Class
- Race Condition
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Race condition in batman-adv allows a hard interface to be disassociated from its soft interface before a pending batadv_v_elp_throughput_metric_update work item completes, resulting in use-after-free and kernel panic during interface removal or reboot.
Why it matters to the business
Unexpected kernel crashes on systems using batman-adv for wireless mesh networking can cause service outages, reboot loops, and operational disruption, especially in environments that frequently manage network interfaces.
How an attack unfolds
An attacker or automated process triggers hard interface removal (for example via network configuration change or reboot) while a delayed metric update work item is queued; the work then executes after the soft interface association is gone, dereferencing freed memory and crashing the kernel.
How to fix it
Upgrade the Linux kernel to a version containing commit 167422a07096a6006599067c8b55884064fa0b72 or later stable releases that include the reference-counting fix for batadv_hardif_neigh_node and batadv_hard_iface.
How to confirm the fix worked
Verify the running kernel contains commit 167422a07096a6006599067c8b55884064fa0b72; confirm absence of the panic call trace involving batadv_v_elp_throughput_metric_update after interface removal operations.
Typical attack path
- Obtain local or network-adjacent access sufficient to trigger interface removal or reboot
- Ensure a batadv_hardif_neigh_node metric_work item is queued or delayed
- Perform hard interface removal while the work item is still pending
- Work handler executes after soft_iface association is cleared, causing panic in batadv_v_elp_throughput_metric_update
How to detect it
Search kernel logs and crash dumps for the call trace containing batadv_v_mesh_free, batadv_v_elp_throughput_metric_update, and worker_thread; look for repeated panics coinciding with interface removal events.
- batadv_v_elp_throughput_metric_update+0x1c/0xa4
- batadv_v_mesh_free+0xd0/0x4dc [batman_adv]
- hardif_neigh->bat_v.metric_work
- process_one_work+0x178/0x398
What your security team should do
- Apply the referenced kernel commit or updated distribution packages immediately on all systems using batman-adv
- Prioritize patching in environments that perform frequent interface changes or automated reboots
- Monitor kernel logs for batadv-related panics until patches are deployed
The record
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 packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | linux | 0 | No fix |
| Debian:11 | linux-6.1 | 0 | 6.1.129-1~deb11u1 |
| Debian:12 | linux | 0 | No fix |
| Debian:13 | linux | 0 | No fix |
| Debian:13 | linux | 0 | 6.12.16-1 |
| Linux | Kernel | 4.6.0 | 5.4.291 |
| SUSE:Linux Enterprise High Availability Extension 15 SP6 | kernel-default | 0 | 6.4.0-150600.23.47.2 |
| SUSE:Linux Enterprise Live Patching 15 SP6 | kernel-default | 0 | 6.4.0-150600.23.47.2 |
| SUSE:Linux Enterprise Live Patching 15 SP6 | kernel-livepatch-SLE15-SP6-RT_Update_10 | 0 | 1-150600.1.5.1 |
| SUSE:Linux Enterprise Live Patching 15 SP6 | kernel-livepatch-SLE15-SP6_Update_10 | 0 | 1-150600.13.5.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP6 | kernel-64kb | 0 | 6.4.0-150600.23.47.2 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP6 | kernel-default | 0 | 6.4.0-150600.23.47.2 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP6 | kernel-default-base | 0 | 6.4.0-150600.23.47.2.150600.12.20.2 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP6 | kernel-source | 0 | 6.4.0-150600.23.47.2 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP6 | kernel-zfcpdump | 0 | 6.4.0-150600.23.47.2 |
| SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 | kernel-coco | 0 | 6.4.0-15061.21.coco15sp6.1 |
| SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 | kernel-coco_debug | 0 | 6.4.0-15061.21.coco15sp6.1 |
| SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 | kernel-source-coco | 0 | 6.4.0-15061.21.coco15sp6.1 |
| SUSE:Linux Enterprise Module for Confidential Computing Technical Preview 15 SP6 | kernel-syms-coco | 0 | 6.4.0-15061.21.coco15sp6.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP6 | kernel-docs | 0 | 6.4.0-150600.23.47.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP6 | kernel-obs-build | 0 | 6.4.0-150600.23.47.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP6 | kernel-source | 0 | 6.4.0-150600.23.47.2 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP6 | kernel-syms | 0 | 6.4.0-150600.23.47.1 |
| SUSE:Linux Enterprise Module for Legacy 15 SP6 | kernel-default | 0 | 6.4.0-150600.23.47.2 |
| SUSE:Linux Enterprise Module for Public Cloud 15 SP6 | kernel-azure | 0 | 6.4.0-150600.8.34.2 |
| SUSE:Linux Enterprise Module for Public Cloud 15 SP6 | kernel-source-azure | 0 | 6.4.0-150600.8.34.2 |
| SUSE:Linux Enterprise Module for Public Cloud 15 SP6 | kernel-syms-azure | 0 | 6.4.0-150600.8.34.1 |
| SUSE:Linux Enterprise Workstation Extension 15 SP6 | kernel-default | 0 | 6.4.0-150600.23.47.2 |
| SUSE:Real Time Module 15 SP6 | kernel-rt | 0 | 6.4.0-150600.10.34.1 |
| SUSE:Real Time Module 15 SP6 | kernel-rt_debug | 0 | 6.4.0-150600.10.34.1 |
| SUSE:Real Time Module 15 SP6 | kernel-source-rt | 0 | 6.4.0-150600.10.34.1 |
| SUSE:Real Time Module 15 SP6 | kernel-syms-rt | 0 | 6.4.0-150600.10.34.1 |
| Ubuntu:24.10 | linux-aws | 0 | 6.11.0-1014.15 |
| openSUSE:Leap 15.6 | dtb-aarch64 | 0 | 6.4.0-150600.23.47.1 |
| openSUSE:Leap 15.6 | kernel-64kb | 0 | 6.4.0-150600.23.47.2 |
| openSUSE:Leap 15.6 | kernel-azure | 0 | 6.4.0-150600.8.34.2 |
| openSUSE:Leap 15.6 | kernel-debug | 0 | 6.4.0-150600.23.47.2 |
| openSUSE:Leap 15.6 | kernel-default | 0 | 6.4.0-150600.23.47.2 |
| openSUSE:Leap 15.6 | kernel-default-base | 0 | 6.4.0-150600.23.47.2.150600.12.20.2 |
| openSUSE:Leap 15.6 | kernel-docs | 0 | 6.4.0-150600.23.47.1 |
| openSUSE:Leap 15.6 | kernel-kvmsmall | 0 | 6.4.0-150600.23.47.2 |
| openSUSE:Leap 15.6 | kernel-obs-build | 0 | 6.4.0-150600.23.47.1 |
| openSUSE:Leap 15.6 | kernel-obs-qa | 0 | 6.4.0-150600.23.47.1 |
| openSUSE:Leap 15.6 | kernel-rt | 0 | 6.4.0-150600.10.34.1 |
| openSUSE:Leap 15.6 | kernel-rt_debug | 0 | 6.4.0-150600.10.34.1 |
| openSUSE:Leap 15.6 | kernel-source | 0 | 6.4.0-150600.23.47.2 |
| openSUSE:Leap 15.6 | kernel-source-azure | 0 | 6.4.0-150600.8.34.2 |
| openSUSE:Leap 15.6 | kernel-source-rt | 0 | 6.4.0-150600.10.34.1 |
| openSUSE:Leap 15.6 | kernel-syms | 0 | 6.4.0-150600.23.47.1 |
| openSUSE:Leap 15.6 | kernel-syms-azure | 0 | 6.4.0-150600.8.34.1 |
| openSUSE:Leap 15.6 | kernel-syms-rt | 0 | 6.4.0-150600.10.34.1 |
| openSUSE:Leap 15.6 | kernel-zfcpdump | 0 | 6.4.0-150600.23.47.2 |
Related vulnerabilities
- CVE-2025-39885 In the Linux kernel, the following vulnerability has been resolved: ocfs2: fix recursive… Also affects linux
- CVE-2025-39883 In the Linux kernel, the following vulnerability has been resolved: mm/memory-failure… Also affects linux
- CVE-2025-39876 In the Linux kernel, the following vulnerability has been resolved: net: fec: Fix… Also affects linux
- CVE-2025-39869 In the Linux kernel, the following vulnerability has been resolved: dmaengine: ti: edma… Also affects linux
- CVE-2025-39873 In the Linux kernel, the following vulnerability has been resolved: can: xilinx_can… Also affects linux
- CVE-2025-39863 In the Linux kernel, the following vulnerability has been resolved: wifi: brcmfmac: fix… Also affects linux
- CVE-2025-39865 In the Linux kernel, the following vulnerability has been resolved: tee: fix NULL pointer… Also affects linux
- CVE-2025-39866 In the Linux kernel, the following vulnerability has been resolved: fs: writeback: fix… Also affects linux