Skip to main content

CVE-2021-47198: Vulnerability in Linux Linux

High
VulnerabilityCVE-2021-47198cvecve-2021-47198
Published: Wed Apr 10 2024 (04/10/2024, 18:56:33 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: scsi: lpfc: Fix use-after-free in lpfc_unreg_rpi() routine An error is detected with the following report when unloading the driver: "KASAN: use-after-free in lpfc_unreg_rpi+0x1b1b" The NLP_REG_LOGIN_SEND nlp_flag is set in lpfc_reg_fab_ctrl_node(), but the flag is not cleared upon completion of the login. This allows a second call to lpfc_unreg_rpi() to proceed with nlp_rpi set to LPFC_RPI_ALLOW_ERROR. This results in a use after free access when used as an rpi_ids array index. Fix by clearing the NLP_REG_LOGIN_SEND nlp_flag in lpfc_mbx_cmpl_fc_reg_login().

AI-Powered Analysis

AILast updated: 06/26/2025, 17:35:24 UTC

Technical Analysis

CVE-2021-47198 is a use-after-free vulnerability identified in the Linux kernel's lpfc (LightPulse Fibre Channel) driver, specifically within the lpfc_unreg_rpi() routine. The vulnerability arises due to improper handling of the NLP_REG_LOGIN_SEND flag in the lpfc_reg_fab_ctrl_node() function. This flag is set during the login process but is not cleared upon completion, allowing a second invocation of lpfc_unreg_rpi() to proceed while the nlp_rpi is set to LPFC_RPI_ALLOW_ERROR. Consequently, this leads to a use-after-free condition when the nlp_rpi value is used as an index into the rpi_ids array. The use-after-free bug can cause memory corruption, potentially leading to kernel crashes or arbitrary code execution in kernel context. The root cause is a failure to clear the NLP_REG_LOGIN_SEND flag in the completion handler lpfc_mbx_cmpl_fc_reg_login(), which was addressed by the patch. This vulnerability affects versions of the Linux kernel containing the vulnerable commit (1da177e4c3f41524e886b7f1b8a0c1fc7321cac2) and impacts systems using the lpfc driver, typically those with Fibre Channel Host Bus Adapters (HBAs) for storage networking. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, the impact of CVE-2021-47198 can be significant, especially for enterprises relying on Linux servers with Fibre Channel storage infrastructure, such as data centers, cloud providers, and large enterprises with SAN (Storage Area Network) environments. Exploitation of this vulnerability could lead to denial of service through kernel crashes or potentially privilege escalation if an attacker can execute arbitrary code in kernel space. This could compromise the confidentiality, integrity, and availability of critical data and services. Given that Fibre Channel is widely used in high-performance storage networks, organizations in sectors like finance, healthcare, telecommunications, and government could face operational disruptions and data breaches if this vulnerability is exploited. The absence of known exploits reduces immediate risk, but the vulnerability's nature warrants proactive patching to prevent future attacks.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernel to versions where this vulnerability is patched, ensuring the lpfc driver includes the fix that clears the NLP_REG_LOGIN_SEND flag appropriately. Specifically, system administrators should: 1) Identify all systems using the lpfc driver, particularly those with Fibre Channel HBAs. 2) Apply vendor-supplied kernel updates or patches that address CVE-2021-47198 promptly. 3) If immediate patching is not feasible, consider temporarily disabling the lpfc driver or isolating affected systems from untrusted networks to reduce attack surface. 4) Monitor kernel logs for KASAN (Kernel Address Sanitizer) reports or unusual lpfc driver errors that may indicate exploitation attempts. 5) Implement strict access controls and network segmentation around storage networks to limit exposure. 6) Engage with hardware vendors for firmware updates or mitigations if applicable. These steps go beyond generic advice by focusing on the specific driver and environment impacted.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-03-25T09:12:14.116Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9835c4522896dcbea024

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

Last enriched: 6/26/2025, 5:35:24 PM

Last updated: 8/1/2025, 6:57:50 AM

Views: 12

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