Skip to main content

CVE-2024-35825: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-35825cvecve-2024-35825
Published: Fri May 17 2024 (05/17/2024, 13:27:28 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: usb: gadget: ncm: Fix handling of zero block length packets While connecting to a Linux host with CDC_NCM_NTB_DEF_SIZE_TX set to 65536, it has been observed that we receive short packets, which come at interval of 5-10 seconds sometimes and have block length zero but still contain 1-2 valid datagrams present. According to the NCM spec: "If wBlockLength = 0x0000, the block is terminated by a short packet. In this case, the USB transfer must still be shorter than dwNtbInMaxSize or dwNtbOutMaxSize. If exactly dwNtbInMaxSize or dwNtbOutMaxSize bytes are sent, and the size is a multiple of wMaxPacketSize for the given pipe, then no ZLP shall be sent. wBlockLength= 0x0000 must be used with extreme care, because of the possibility that the host and device may get out of sync, and because of test issues. wBlockLength = 0x0000 allows the sender to reduce latency by starting to send a very large NTB, and then shortening it when the sender discovers that there’s not sufficient data to justify sending a large NTB" However, there is a potential issue with the current implementation, as it checks for the occurrence of multiple NTBs in a single giveback by verifying if the leftover bytes to be processed is zero or not. If the block length reads zero, we would process the same NTB infintely because the leftover bytes is never zero and it leads to a crash. Fix this by bailing out if block length reads zero.

AI-Powered Analysis

AILast updated: 06/28/2025, 03:25:18 UTC

Technical Analysis

CVE-2024-35825 is a vulnerability identified in the Linux kernel's USB gadget subsystem, specifically affecting the Network Control Model (NCM) implementation. The issue arises from improper handling of zero block length packets within the CDC_NCM (Communication Device Class - Network Control Model) protocol. The vulnerability manifests when the Linux host is configured with CDC_NCM_NTB_DEF_SIZE_TX set to 65536 bytes and receives short USB packets at intervals of 5-10 seconds. These packets have a block length field set to zero but still contain 1-2 valid datagrams. According to the NCM specification, a zero block length (wBlockLength = 0x0000) indicates that the block is terminated by a short packet, and the USB transfer must be shorter than the maximum transfer size. This mechanism is designed to reduce latency by allowing the sender to start transmitting a large Network Transfer Block (NTB) and shorten it dynamically if insufficient data is available. However, the Linux kernel's current implementation incorrectly processes these zero-length blocks. It checks for multiple NTBs in a single giveback by verifying if leftover bytes to be processed are zero. When the block length is zero, the leftover bytes never reach zero, causing the kernel to process the same NTB infinitely, leading to a crash (likely a denial of service). The fix involves modifying the kernel to bail out of processing when a zero block length is detected, preventing infinite loops and crashes. This vulnerability affects multiple recent Linux kernel versions identified by specific commit hashes, indicating it is present in actively maintained branches. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to systems running Linux kernels with the affected USB gadget NCM implementation. The impact is mainly a denial of service (DoS) condition caused by kernel crashes when processing malformed or specially crafted USB packets with zero block length. This could disrupt network connectivity on devices using CDC_NCM USB networking, which is common in embedded systems, IoT devices, and specialized networking hardware. Organizations relying on Linux-based network appliances, industrial control systems, or USB networking dongles could experience service interruptions or require system reboots, impacting operational continuity. Although the vulnerability does not appear to allow privilege escalation or remote code execution, the DoS could be leveraged in targeted attacks to disrupt critical infrastructure or business operations. Given the widespread use of Linux in European IT environments, especially in telecommunications, manufacturing, and government sectors, the vulnerability could affect a broad range of devices if exploited. However, exploitation requires USB-level access or connection, limiting remote exploitation but increasing risk in environments with physical access or compromised USB devices.

Mitigation Recommendations

To mitigate this vulnerability, European organizations should: 1) Apply the latest Linux kernel patches that address CVE-2024-35825 as soon as they become available from trusted sources or Linux distributions. 2) Audit and monitor USB device usage, especially CDC_NCM USB network devices, to detect anomalous or malformed USB traffic that could trigger the vulnerability. 3) Implement strict physical security controls to prevent unauthorized USB device connections to critical systems. 4) Where possible, disable or restrict USB gadget functionality on Linux hosts that do not require CDC_NCM networking features. 5) Employ USB traffic filtering or endpoint security solutions capable of inspecting and blocking malformed USB packets. 6) For embedded or IoT devices using affected Linux versions, coordinate with vendors to obtain firmware updates incorporating the fix. 7) Conduct regular system stability and crash monitoring to detect early signs of exploitation attempts. These steps go beyond generic advice by focusing on USB-specific controls and kernel patch management tailored to the nature of this vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-05-17T12:19:12.347Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9821c4522896dcbddc5b

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

Last enriched: 6/28/2025, 3:25:18 AM

Last updated: 7/28/2025, 9:56:43 AM

Views: 11

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