Skip to main content

CVE-2021-47622: Vulnerability in Linux Linux

High
VulnerabilityCVE-2021-47622cvecve-2021-47622
Published: Tue Jul 16 2024 (07/16/2024, 11:29:38 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: scsi: ufs: Fix a deadlock in the error handler The following deadlock has been observed on a test setup: - All tags allocated - The SCSI error handler calls ufshcd_eh_host_reset_handler() - ufshcd_eh_host_reset_handler() queues work that calls ufshcd_err_handler() - ufshcd_err_handler() locks up as follows: Workqueue: ufs_eh_wq_0 ufshcd_err_handler.cfi_jt Call trace: __switch_to+0x298/0x5d8 __schedule+0x6cc/0xa94 schedule+0x12c/0x298 blk_mq_get_tag+0x210/0x480 __blk_mq_alloc_request+0x1c8/0x284 blk_get_request+0x74/0x134 ufshcd_exec_dev_cmd+0x68/0x640 ufshcd_verify_dev_init+0x68/0x35c ufshcd_probe_hba+0x12c/0x1cb8 ufshcd_host_reset_and_restore+0x88/0x254 ufshcd_reset_and_restore+0xd0/0x354 ufshcd_err_handler+0x408/0xc58 process_one_work+0x24c/0x66c worker_thread+0x3e8/0xa4c kthread+0x150/0x1b4 ret_from_fork+0x10/0x30 Fix this lockup by making ufshcd_exec_dev_cmd() allocate a reserved request.

AI-Powered Analysis

AILast updated: 06/30/2025, 15:39:59 UTC

Technical Analysis

CVE-2021-47622 is a vulnerability identified in the Linux kernel's SCSI subsystem, specifically affecting the UFS (Universal Flash Storage) host controller driver (ufshcd). The issue arises from a deadlock condition in the error handling code path. The deadlock occurs when all SCSI tags are allocated, and the SCSI error handler invokes ufshcd_eh_host_reset_handler(), which queues work that calls ufshcd_err_handler(). During execution, ufshcd_err_handler() attempts to allocate a request via ufshcd_exec_dev_cmd(), but due to the exhaustion of available tags and the lack of reserved requests, the system locks up. The kernel call trace shows the deadlock occurs within the workqueue context, involving scheduling and request allocation functions. The root cause is that ufshcd_exec_dev_cmd() does not allocate a reserved request, causing the error handler to block indefinitely when no tags are available. The fix involves modifying ufshcd_exec_dev_cmd() to allocate a reserved request, preventing the deadlock by ensuring the error handler can proceed even when all normal tags are in use. This vulnerability affects Linux kernel versions identified by the commit hash 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and was published on July 16, 2024. No known exploits are reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, this vulnerability could lead to system instability or denial of service (DoS) conditions on Linux systems utilizing UFS storage devices, which are common in embedded systems, mobile devices, and some server environments. The deadlock in the error handler can cause the affected system to hang or become unresponsive, impacting availability. This is particularly critical for environments requiring high availability or real-time processing, such as telecommunications infrastructure, industrial control systems, and critical cloud services. While confidentiality and integrity are not directly impacted, the availability disruption could lead to operational downtime, loss of productivity, and potential cascading failures in dependent systems. Organizations relying on Linux kernels with the vulnerable UFS driver in their infrastructure should consider this a significant stability risk. Since no known exploits are currently reported, the threat is primarily from accidental triggering or fault conditions rather than targeted attacks, but the potential for future exploitation exists once the vulnerability is publicly known.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernel to a version that includes the fix for CVE-2021-47622. Specifically, ensure that the kernel version incorporates the patch that modifies ufshcd_exec_dev_cmd() to allocate reserved requests during error handling. For embedded or specialized devices where kernel updates are less frequent, vendors should be contacted for firmware or kernel patches addressing this issue. Additionally, organizations should audit systems using UFS storage to identify vulnerable devices and consider temporary mitigations such as limiting workloads that heavily utilize SCSI tags or implementing monitoring to detect symptoms of deadlock (e.g., system hangs or unresponsive error handlers). Implementing robust system monitoring and alerting for kernel hangs or workqueue stalls can help detect exploitation or triggering of this vulnerability early. Finally, testing updates in controlled environments before deployment is recommended to ensure stability and compatibility.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-07-16T11:26:52.955Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9834c4522896dcbe960d

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

Last enriched: 6/30/2025, 3:39:59 PM

Last updated: 8/12/2025, 3:03:41 PM

Views: 15

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