Skip to main content

CVE-2021-47421: Vulnerability in Linux Linux

High
VulnerabilityCVE-2021-47421cvecve-2021-47421
Published: Tue May 21 2024 (05/21/2024, 15:04:09 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: drm/amdgpu: handle the case of pci_channel_io_frozen only in amdgpu_pci_resume In current code, when a PCI error state pci_channel_io_normal is detectd, it will report PCI_ERS_RESULT_CAN_RECOVER status to PCI driver, and PCI driver will continue the execution of PCI resume callback report_resume by pci_walk_bridge, and the callback will go into amdgpu_pci_resume finally, where write lock is releasd unconditionally without acquiring such lock first. In this case, a deadlock will happen when other threads start to acquire the read lock. To fix this, add a member in amdgpu_device strucutre to cache pci_channel_state, and only continue the execution in amdgpu_pci_resume when it's pci_channel_io_frozen.

AI-Powered Analysis

AILast updated: 06/30/2025, 12:42:02 UTC

Technical Analysis

CVE-2021-47421 is a vulnerability identified in the Linux kernel specifically within the AMD GPU driver component (amdgpu) related to PCI error handling during device resume operations. The issue arises in the handling of PCI error states, particularly when transitioning from a pci_channel_io_frozen state back to normal operation. In the current vulnerable code, when the PCI error state pci_channel_io_normal is detected, the PCI driver reports a recoverable error status (PCI_ERS_RESULT_CAN_RECOVER) and proceeds to execute the PCI resume callback via pci_walk_bridge, eventually invoking amdgpu_pci_resume. Within this function, a write lock is released unconditionally without first being acquired, which is a logical error. This improper lock management can lead to a deadlock scenario when other threads attempt to acquire the corresponding read lock, effectively halting progress and potentially causing system instability or hangs. The fix implemented involves adding a member to the amdgpu_device structure to cache the pci_channel_state and modifying amdgpu_pci_resume to only proceed with resume operations if the PCI channel is in the pci_channel_io_frozen state. This ensures that lock release operations are correctly synchronized with the PCI error recovery state, preventing deadlocks. While this vulnerability does not have any known exploits in the wild as of the publication date, it affects Linux kernel versions containing the specified commit hashes, which are likely part of recent kernel releases. The vulnerability is subtle and relates to concurrency and error recovery in kernel device drivers, which are critical for system stability and reliability.

Potential Impact

For European organizations relying on Linux-based systems with AMD GPU hardware, this vulnerability could lead to system deadlocks during PCI error recovery, causing unexpected system hangs or crashes. This can disrupt critical services, especially in environments where high availability and uptime are essential, such as financial institutions, healthcare providers, and industrial control systems. The deadlock could also complicate incident response and recovery efforts, potentially leading to longer downtimes. Although no active exploitation is reported, the vulnerability poses a risk to the integrity and availability of systems running vulnerable Linux kernels with affected AMD GPU drivers. Organizations using Linux servers, workstations, or embedded devices with AMD GPUs should be aware of this risk, as it may affect both desktop and server environments. The impact on confidentiality is minimal since the vulnerability does not involve data leakage or privilege escalation, but the availability and integrity of systems could be compromised due to deadlocks and system instability.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernel to versions that include the patch for CVE-2021-47421. Since the vulnerability is in the amdgpu driver, ensuring that the kernel and associated AMD GPU drivers are up to date is critical. Specifically, organizations should: 1) Identify all Linux systems with AMD GPU hardware and verify kernel versions against the patched commits. 2) Apply kernel updates from trusted Linux distributions that have incorporated the fix or manually patch and rebuild the kernel if necessary. 3) Test updated kernels in staging environments to confirm stability and absence of deadlocks before production deployment. 4) Monitor system logs for PCI error messages or unusual lock contention patterns that could indicate attempts to exploit this vulnerability. 5) Implement robust system monitoring and alerting to detect system hangs or deadlocks promptly. 6) Consider isolating critical workloads from systems with vulnerable kernels until patches are applied. 7) Engage with Linux distribution vendors and AMD for any additional guidance or updated drivers. These steps go beyond generic advice by focusing on hardware-specific driver updates, targeted system identification, and proactive monitoring for PCI error states.

Need more detailed analysis?Get Pro

Technical Details

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

Threat ID: 682d9833c4522896dcbe90dc

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

Last enriched: 6/30/2025, 12:42:02 PM

Last updated: 8/14/2025, 10:38:34 AM

Views: 16

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