Skip to main content

CVE-2025-21781: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2025-21781cvecve-2025-21781
Published: Thu Feb 27 2025 (02/27/2025, 02:18:24 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

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]

AI-Powered Analysis

AILast updated: 06/30/2025, 09:09:56 UTC

Technical Analysis

CVE-2025-21781 is a vulnerability identified in the Linux kernel specifically affecting the batman-adv (Better Approach To Mobile Adhoc Networking advanced) module, which is used for mesh networking. The issue arises from improper handling of reference counting and interface association during asynchronous work related to throughput metric updates. The vulnerability manifests as a kernel panic (crash) triggered during the removal of network interfaces, particularly during system reboot sequences. The root cause is that while reference counting prevents premature freeing of certain data structures (batadv_hardif_neigh_node and batadv_hard_iface), there is no guarantee that the hard interface remains associated with the soft interface until the completion of the asynchronous work (batadv_v_elp_throughput_metric_update). This race condition leads to a use-after-free or invalid memory access scenario, causing the kernel to panic. The crash is reproducible and was confirmed by modifying the metric update work to delayed work, which helped identify the timing issue. The fix involves ensuring that the throughput metric update work does not proceed without a valid soft interface association, preventing the kernel panic. This vulnerability affects specific Linux kernel versions identified by the commit hash c833484e5f3872a38fe232c663586069d5ad9645. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, the impact of this vulnerability primarily concerns systems running Linux kernels with the batman-adv module enabled and actively used for mesh networking. Such environments are common in research institutions, telecommunications, and specialized industrial or IoT deployments that rely on mesh networks for resilient connectivity. The kernel panic triggered by this vulnerability can lead to unexpected system crashes and reboots, resulting in denial of service (DoS). This can disrupt critical network infrastructure, cause data loss in volatile memory, and degrade operational continuity. While the vulnerability does not directly lead to privilege escalation or remote code execution, the availability impact can be significant for organizations relying on mesh networks for communication, especially in sectors like utilities, transportation, and emergency services. Additionally, repeated crashes may increase maintenance costs and reduce trust in Linux-based networking solutions. Since the vulnerability is triggered during interface removal or reboot, it may also affect automated update or maintenance procedures, complicating patch deployment and system management.

Mitigation Recommendations

1. Immediate patching: Apply the official Linux kernel patch that addresses this issue by ensuring the throughput metric update work does not execute without a valid soft interface association. Monitor Linux kernel updates and backport fixes if necessary for long-term support kernels. 2. Disable batman-adv if not required: For systems not utilizing mesh networking, consider disabling or removing the batman-adv module to eliminate exposure. 3. Controlled reboot procedures: Implement controlled and monitored reboot sequences to minimize the risk of triggering the panic during interface removal. 4. System monitoring: Deploy kernel crash monitoring and alerting to detect and respond quickly to any panic events related to this vulnerability. 5. Testing environments: Before deploying patches in production, test them in staging environments that replicate mesh networking configurations to ensure stability. 6. Network segmentation: Isolate mesh network nodes to limit the impact of potential crashes on broader network infrastructure. 7. Vendor coordination: For commercial Linux distributions, coordinate with vendors to obtain timely patches and guidance tailored to specific kernel versions and deployments.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-12-29T08:45:45.764Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9832c4522896dcbe87c5

Added to database: 5/21/2025, 9:09:06 AM

Last enriched: 6/30/2025, 9:09:56 AM

Last updated: 8/17/2025, 6:58:17 PM

Views: 14

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats