Skip to main content

CVE-2025-21681: Vulnerability in Linux Linux

High
VulnerabilityCVE-2025-21681cvecve-2025-21681
Published: Fri Jan 31 2025 (01/31/2025, 11:25:41 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: openvswitch: fix lockup on tx to unregistering netdev with carrier Commit in a fixes tag attempted to fix the issue in the following sequence of calls: do_output -> ovs_vport_send -> dev_queue_xmit -> __dev_queue_xmit -> netdev_core_pick_tx -> skb_tx_hash When device is unregistering, the 'dev->real_num_tx_queues' goes to zero and the 'while (unlikely(hash >= qcount))' loop inside the 'skb_tx_hash' becomes infinite, locking up the core forever. But unfortunately, checking just the carrier status is not enough to fix the issue, because some devices may still be in unregistering state while reporting carrier status OK. One example of such device is a net/dummy. It sets carrier ON on start, but it doesn't implement .ndo_stop to set the carrier off. And it makes sense, because dummy doesn't really have a carrier. Therefore, while this device is unregistering, it's still easy to hit the infinite loop in the skb_tx_hash() from the OVS datapath. There might be other drivers that do the same, but dummy by itself is important for the OVS ecosystem, because it is frequently used as a packet sink for tcpdump while debugging OVS deployments. And when the issue is hit, the only way to recover is to reboot. Fix that by also checking if the device is running. The running state is handled by the net core during unregistering, so it covers unregistering case better, and we don't really need to send packets to devices that are not running anyway. While only checking the running state might be enough, the carrier check is preserved. The running and the carrier states seem disjoined throughout the code and different drivers. And other core functions like __dev_direct_xmit() check both before attempting to transmit a packet. So, it seems safer to check both flags in OVS as well.

AI-Powered Analysis

AILast updated: 06/27/2025, 23:39:49 UTC

Technical Analysis

CVE-2025-21681 is a vulnerability in the Linux kernel's Open vSwitch (OVS) datapath component that can cause a kernel lockup (infinite loop) during packet transmission when a network device is in the process of unregistering. The root cause lies in the skb_tx_hash() function, which calculates the transmit queue index for outgoing packets. When a device is unregistering, its real_num_tx_queues value can drop to zero, causing the loop condition 'while (unlikely(hash >= qcount))' inside skb_tx_hash() to become infinite, effectively locking the kernel core indefinitely. The initial fix attempted to check the carrier status of the device to avoid this condition, but this was insufficient because some devices, such as the net/dummy device, report carrier ON even while unregistering and do not implement the .ndo_stop method to clear the carrier status. This leads to the infinite loop being triggered despite the carrier check. The vulnerability is particularly impactful for OVS deployments that use dummy devices as packet sinks for debugging, as hitting this bug requires a system reboot to recover. The final fix involves checking both the device's running state and carrier status before transmitting packets. The running state is managed by the network core during device unregistering and provides a more reliable indicator to prevent packet transmission attempts to unregistering devices. This dual check aligns with other core functions like __dev_direct_xmit(), which also verify both flags before transmission. This vulnerability affects multiple Linux kernel versions identified by specific commit hashes and was published on January 31, 2025. There are no known exploits in the wild at this time, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, especially those operating large-scale data centers, cloud infrastructure, or network virtualization environments using Linux with Open vSwitch, this vulnerability poses a risk of kernel lockups leading to denial of service (DoS). The infinite loop in the kernel can cause system hangs requiring reboots, resulting in service downtime and potential disruption of critical network functions. Organizations relying on OVS for network virtualization, container networking, or software-defined networking (SDN) may experience degraded network performance or outages. The impact is particularly significant for environments using dummy network devices for debugging or packet capture, as these devices are more prone to triggering the issue. While no direct data breach or privilege escalation is indicated, the availability impact can affect business continuity, especially in sectors such as telecommunications, finance, and cloud service providers prevalent in Europe. Recovery requires system reboot, which may not be feasible in high-availability scenarios without planned maintenance windows. The lack of known exploits reduces immediate risk, but the vulnerability's presence in widely deployed Linux kernels means that unpatched systems remain vulnerable to accidental or targeted triggering of the lockup.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernels to versions that include the fix for CVE-2025-21681. Specifically, ensure that the kernel version includes the patch that adds the running state check alongside the carrier status in the OVS datapath. For environments where immediate patching is not possible, consider the following mitigations: 1) Avoid using dummy network devices or other devices that do not implement proper carrier state transitions during unregistering in production OVS deployments. 2) Implement monitoring to detect symptoms of kernel lockups or hangs related to network device unregistering events. 3) Use kernel crash dump and logging mechanisms to capture state before reboots to aid in diagnosis. 4) In containerized or virtualized environments, isolate OVS instances and limit exposure to untrusted network device manipulations. 5) Coordinate with network and system teams to schedule maintenance windows for kernel upgrades to minimize operational impact. 6) Engage with Linux distribution vendors to obtain backported patches if using long-term support kernels. These steps go beyond generic advice by focusing on device-specific behavior and operational practices relevant to OVS and network device lifecycle management.

Need more detailed analysis?Get Pro

Technical Details

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

Threat ID: 682d9820c4522896dcbdd2d2

Added to database: 5/21/2025, 9:08:48 AM

Last enriched: 6/27/2025, 11:39:49 PM

Last updated: 7/31/2025, 5:46:33 PM

Views: 16

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