Skip to main content

CVE-2021-46906: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2021-46906cvecve-2021-46906
Published: Mon Feb 26 2024 (02/26/2024, 17:20:22 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: HID: usbhid: fix info leak in hid_submit_ctrl In hid_submit_ctrl(), the way of calculating the report length doesn't take into account that report->size can be zero. When running the syzkaller reproducer, a report of size 0 causes hid_submit_ctrl) to calculate transfer_buffer_length as 16384. When this urb is passed to the usb core layer, KMSAN reports an info leak of 16384 bytes. To fix this, first modify hid_report_len() to account for the zero report size case by using DIV_ROUND_UP for the division. Then, call it from hid_submit_ctrl().

AI-Powered Analysis

AILast updated: 06/26/2025, 10:08:40 UTC

Technical Analysis

CVE-2021-46906 is a vulnerability identified in the Linux kernel's USB Human Interface Device (HID) subsystem, specifically within the function hid_submit_ctrl(). The issue arises from improper handling of the report length calculation when the HID report size is zero. The function hid_submit_ctrl() calculates the transfer_buffer_length based on the report size, but it does not account for the case where report->size is zero. This leads to an incorrect calculation where the transfer_buffer_length is set to 16384 bytes. When this oversized buffer length is passed to the USB core layer, Kernel Memory Sanitizer (KMSAN) detects an information leak of 16384 bytes. The root cause is that the function hid_report_len() does not properly handle zero-sized reports, resulting in an overestimation of the buffer length. The fix involves modifying hid_report_len() to correctly handle zero report sizes by using the DIV_ROUND_UP macro for division, ensuring accurate length calculation, and then calling this corrected function from hid_submit_ctrl(). This vulnerability could potentially allow an attacker to leak kernel memory contents, which may include sensitive information, through crafted USB HID reports. Although no known exploits are reported in the wild, the vulnerability represents an information leak risk in the Linux kernel's USB HID handling code. The affected versions are identified by a specific commit hash, indicating that this issue is present in certain Linux kernel builds prior to the patch date of February 26, 2024.

Potential Impact

For European organizations, the impact of CVE-2021-46906 primarily concerns confidentiality risks due to potential kernel memory information leaks. Attackers with local access or the ability to interact with USB HID devices could exploit this flaw to extract sensitive kernel memory data, which might include cryptographic keys, passwords, or other confidential information. This could facilitate further privilege escalation or lateral movement within affected systems. Given the widespread use of Linux in European enterprise servers, cloud infrastructure, and embedded systems, especially in sectors like finance, telecommunications, and critical infrastructure, the vulnerability could expose sensitive operational data. However, exploitation requires interaction with USB HID devices and possibly local access, limiting remote exploitation scenarios. The absence of known exploits reduces immediate risk but does not eliminate the threat, especially in environments with untrusted USB devices or where USB device usage is common. Organizations relying on Linux-based systems for critical operations should consider this vulnerability as a potential vector for information disclosure that could undermine system integrity and confidentiality.

Mitigation Recommendations

European organizations should implement the following specific mitigation measures: 1) Apply the official Linux kernel patches that address CVE-2021-46906 as soon as they become available from trusted Linux distribution vendors or the Linux kernel mainline. 2) Restrict physical and logical access to USB ports, especially on critical systems, to prevent unauthorized USB device connections that could trigger the vulnerability. This can be achieved through USB port control policies, endpoint security solutions, or hardware port blockers. 3) Employ USB device whitelisting to allow only trusted HID devices, reducing the risk of malicious device interaction. 4) Monitor kernel logs and USB subsystem activity for unusual or unexpected HID report sizes or errors that could indicate exploitation attempts. 5) In environments where patching is delayed, consider disabling USB HID support if feasible, or isolate vulnerable systems from untrusted networks and users. 6) Educate system administrators and security teams about the vulnerability to ensure timely detection and response. These measures go beyond generic advice by focusing on controlling USB device interactions and monitoring kernel-level behavior specific to this vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-02-25T13:45:52.717Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9835c4522896dcbea653

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

Last enriched: 6/26/2025, 10:08:40 AM

Last updated: 8/13/2025, 9:11:39 AM

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