CVE-2021-47617 in Linux
Summary
by MITRE • 06/20/2024
In the Linux kernel, the following vulnerability has been resolved:
PCI: pciehp: Fix infinite loop in IRQ handler upon power fault
The Power Fault Detected bit in the Slot Status register differs from all other hotplug events in that it is sticky: It can only be cleared after turning off slot power. Per PCIe r5.0, sec. 6.7.1.8:
If a power controller detects a main power fault on the hot-plug slot, it must automatically set its internal main power fault latch [...].
The main power fault latch is cleared when software turns off power to the hot-plug slot.
The stickiness used to cause interrupt storms and infinite loops which were fixed in 2009 by commits 5651c48cfafe ("PCI pciehp: fix power fault interrupt storm problem") and 99f0169c17f3 ("PCI: pciehp: enable software notification on empty slots").
Unfortunately in 2020 the infinite loop issue was inadvertently reintroduced by commit 8edf5332c393 ("PCI: pciehp: Fix MSI interrupt race"): The hardirq handler pciehp_isr() clears the PFD bit until pciehp's power_fault_detected flag is set. That happens in the IRQ thread pciehp_ist(), which never learns of the event because the hardirq handler is stuck in an infinite loop. Fix by setting the power_fault_detected flag already in the hardirq handler.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 10/04/2025
The vulnerability CVE-2021-47617 represents a critical flaw in the Linux kernel's PCI express hotplug subsystem that manifests as an infinite loop within the interrupt handler. This issue specifically affects the pciehp driver component responsible for managing PCIe slot hotplug operations and power management. The root cause stems from a fundamental misunderstanding of how the Power Fault Detected bit operates within the PCIe specification, creating a condition where interrupt processing becomes trapped in an endless cycle.
The technical flaw originates from the sticky nature of the Power Fault Detected bit in the Slot Status register, which behaves differently from all other hotplug events in the PCIe specification. According to PCIe r5.0, section 6.7.1.8, when a power controller detects a main power fault on a hot-plug slot, it must automatically set an internal main power fault latch that can only be cleared after software turns off power to the hot-plug slot. This design decision creates a unique operational challenge where the interrupt handler must properly manage the state transition between hardware detection and software clearing operations.
The vulnerability was initially addressed in 2009 through two separate commits that successfully resolved interrupt storm problems and enabled software notification on empty slots. However, a regression occurred in 2020 when commit 8edf5332c393 introduced a fix for MSI interrupt race conditions that inadvertently reintroduced the infinite loop issue. The problematic code structure causes the hardirq handler pciehp_isr() to continuously clear the PFD bit while waiting for the power_fault_detected flag to be set, but this flag is only updated in the IRQ thread pciehp_ist() which never receives notification due to the handler being trapped in the loop.
This infinite loop condition creates severe operational impacts including system hangs, complete loss of interrupt responsiveness, and potential denial of service scenarios that can affect entire server or workstation operations. The issue particularly impacts systems with PCIe hotplug capabilities where power management events occur frequently, as the interrupt storm can render the system unresponsive to other PCI events and potentially cause complete system lockups. The vulnerability demonstrates a classic race condition problem where timing dependencies between hardware interrupt handling and software state management create unpredictable system behavior.
The fix implemented addresses the core issue by ensuring that the power_fault_detected flag is set within the hardirq handler itself rather than waiting for the IRQ thread to process the event. This modification aligns with the established PCIe specification requirements and prevents the infinite loop condition that occurred when the interrupt handler became trapped in its own clearing logic. The solution follows established security practices for interrupt handling in kernel space and addresses the specific CWE category related to improper handling of interrupt conditions. Organizations should prioritize applying this patch as it resolves a critical reliability issue that can lead to complete system outages and affects the fundamental interrupt processing capabilities of PCIe hotplug systems.