Skip to main content

CVE-2021-47378: Vulnerability in Linux Linux

Critical
VulnerabilityCVE-2021-47378cvecve-2021-47378
Published: Tue May 21 2024 (05/21/2024, 15:03:41 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: nvme-rdma: destroy cm id before destroy qp to avoid use after free We should always destroy cm_id before destroy qp to avoid to get cma event after qp was destroyed, which may lead to use after free. In RDMA connection establishment error flow, don't destroy qp in cm event handler.Just report cm_error to upper level, qp will be destroy in nvme_rdma_alloc_queue() after destroy cm id.

AI-Powered Analysis

AILast updated: 07/03/2025, 05:11:17 UTC

Technical Analysis

CVE-2021-47378 is a critical vulnerability in the Linux kernel specifically affecting the nvme-rdma subsystem, which handles NVMe over RDMA (Remote Direct Memory Access) connections. The vulnerability arises from improper destruction order of connection management identifiers (cm_id) and queue pairs (qp) during RDMA connection teardown. The kernel code failed to destroy the cm_id before destroying the qp, which could lead to a use-after-free condition. This occurs because a connection management (cma) event may be received after the qp has already been destroyed, causing the kernel to reference freed memory. The vulnerability is rooted in the error handling flow during RDMA connection establishment, where the qp was destroyed prematurely in the cm event handler instead of deferring destruction until after the cm_id was destroyed. This flaw corresponds to CWE-416 (Use After Free), a serious memory safety issue that can lead to arbitrary code execution, kernel crashes, or privilege escalation. The CVSS v3.1 score is 9.8 (critical), reflecting the vulnerability's ability to be exploited remotely without authentication or user interaction, with full impact on confidentiality, integrity, and availability. Although no known exploits are currently reported in the wild, the severity and ease of exploitation make it a significant threat. The vulnerability affects Linux kernel versions identified by the commit hash 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and likely related kernel releases incorporating this code. The fix involves ensuring the cm_id is destroyed before the qp to prevent use-after-free conditions and adjusting the error handling flow to report connection management errors without prematurely destroying the qp. This vulnerability is particularly relevant to environments using NVMe over RDMA for high-performance storage networking, common in data centers and enterprise infrastructures.

Potential Impact

For European organizations, the impact of CVE-2021-47378 can be substantial, especially for those relying on Linux-based servers and infrastructure utilizing NVMe over RDMA for storage networking. Exploitation could allow attackers to execute arbitrary code within the kernel context, leading to full system compromise, data breaches, or denial of service. This could disrupt critical services, cause data loss, and impact business continuity. Sectors such as finance, telecommunications, cloud service providers, and research institutions that depend on high-performance storage solutions are particularly at risk. The vulnerability's remote exploitability without authentication increases the attack surface, potentially allowing external threat actors to target exposed systems over the network. Given the criticality of the flaw and the widespread use of Linux in European data centers and cloud environments, organizations face a heightened risk of targeted attacks or opportunistic exploitation if patches are not applied promptly.

Mitigation Recommendations

European organizations should prioritize the following mitigation steps: 1) Immediate patching of affected Linux kernel versions with the updated code that corrects the destruction order of cm_id and qp in the nvme-rdma subsystem. 2) Audit and inventory systems to identify those using NVMe over RDMA, focusing on data center and storage infrastructure. 3) Implement network segmentation and strict firewall rules to limit exposure of RDMA services to untrusted networks, reducing the attack surface. 4) Monitor kernel logs and system behavior for anomalies related to RDMA connection management events that could indicate exploitation attempts. 5) Engage with Linux distribution vendors and apply vendor-specific security updates as they become available. 6) For environments where immediate patching is not feasible, consider disabling NVMe over RDMA functionality temporarily to mitigate risk. 7) Incorporate this vulnerability into incident response and threat hunting activities to detect potential exploitation. These recommendations go beyond generic advice by focusing on the specific subsystem affected and operational contexts where NVMe over RDMA is deployed.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-05-21T14:58:30.811Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d9833c4522896dcbe8f63

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

Last enriched: 7/3/2025, 5:11:17 AM

Last updated: 8/11/2025, 6:11:15 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