Skip to main content

CVE-2021-46904: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2021-46904cvecve-2021-46904
Published: Sun Feb 25 2024 (02/25/2024, 14:03:40 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: net: hso: fix null-ptr-deref during tty device unregistration Multiple ttys try to claim the same the minor number causing a double unregistration of the same device. The first unregistration succeeds but the next one results in a null-ptr-deref. The get_free_serial_index() function returns an available minor number but doesn't assign it immediately. The assignment is done by the caller later. But before this assignment, calls to get_free_serial_index() would return the same minor number. Fix this by modifying get_free_serial_index to assign the minor number immediately after one is found to be and rename it to obtain_minor() to better reflect what it does. Similary, rename set_serial_by_index() to release_minor() and modify it to free up the minor number of the given hso_serial. Every obtain_minor() should have corresponding release_minor() call.

AI-Powered Analysis

AILast updated: 06/26/2025, 10:09:11 UTC

Technical Analysis

CVE-2021-46904 is a vulnerability in the Linux kernel's handling of hso (High-Speed Option) serial devices, specifically related to tty device unregistration. The root cause is a race condition or logic flaw in the allocation and release of minor device numbers used by tty devices. The function get_free_serial_index() returns an available minor number but does not immediately assign it, allowing multiple tty devices to receive the same minor number before assignment. This leads to multiple tty devices attempting to unregister the same minor number, causing a double unregistration scenario. The first unregistration succeeds, but the subsequent one triggers a null pointer dereference (null-ptr-deref) in the kernel, which can cause a kernel crash (kernel panic) or system instability. The fix involves modifying get_free_serial_index() to assign the minor number immediately upon allocation and renaming it to obtain_minor(), ensuring that each allocation is unique and tracked. Correspondingly, set_serial_by_index() was renamed to release_minor() to properly free the minor number when the device is unregistered. This change prevents multiple devices from claiming the same minor number and eliminates the null pointer dereference during device unregistration. This vulnerability affects Linux kernel versions prior to the patch and impacts systems using the hso driver, which is typically used for certain USB cellular modems or serial devices. There are no known exploits in the wild at the time of publication, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, the impact of this vulnerability depends largely on the deployment of Linux systems using the hso driver, which is common in embedded systems, industrial equipment, and devices using USB cellular modems for connectivity. A successful exploitation could cause kernel crashes leading to denial of service (DoS) conditions, potentially disrupting critical infrastructure, industrial control systems, or telecommunications equipment. This could impact availability of services, especially in sectors relying on embedded Linux devices for network connectivity or control. While the vulnerability does not appear to allow privilege escalation or remote code execution directly, the resulting system instability could be leveraged in multi-stage attacks or cause operational disruptions. European organizations with large Linux deployments, especially in telecommunications, manufacturing, or IoT environments, should be aware of this risk. The absence of known exploits reduces immediate risk, but the vulnerability should be addressed promptly to prevent future exploitation.

Mitigation Recommendations

1. Apply the official Linux kernel patches that fix CVE-2021-46904 as soon as they become available from trusted Linux distribution vendors or the mainline kernel. 2. Identify and inventory all systems using the hso driver or USB cellular modems that rely on the affected Linux kernel versions. 3. For embedded or industrial devices where kernel patching is challenging, consider isolating these devices from critical networks or applying network-level protections to limit exposure. 4. Monitor system logs for kernel panics or tty device errors that could indicate attempts to trigger this vulnerability. 5. Implement robust kernel crash recovery and system monitoring to minimize downtime in case of exploitation. 6. Coordinate with hardware and device vendors to ensure firmware and driver updates incorporate the fix. 7. Avoid running untrusted code or allowing untrusted users to interact with tty devices to reduce risk of triggering the vulnerability.

Need more detailed analysis?Get Pro

Technical Details

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

Threat ID: 682d9835c4522896dcbea63c

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

Last enriched: 6/26/2025, 10:09:11 AM

Last updated: 8/13/2025, 3:25:57 AM

Views: 13

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