CVE-2024-58006 in Linux
Summary
by MITRE • 02/27/2025
In the Linux kernel, the following vulnerability has been resolved:
PCI: dwc: ep: Prevent changing BAR size/flags in pci_epc_set_bar()
In commit 4284c88fff0e ("PCI: designware-ep: Allow pci_epc_set_bar() update inbound map address") set_bar() was modified to support dynamically changing the backing physical address of a BAR that was already configured.
This means that set_bar() can be called twice, without ever calling clear_bar() (as calling clear_bar() would clear the BAR's PCI address assigned by the host).
This can only be done if the new BAR size/flags does not differ from the existing BAR configuration. Add these missing checks.
If we allow set_bar() to set e.g. a new BAR size that differs from the existing BAR size, the new address translation range will be smaller than the BAR size already determined by the host, which would mean that a read past the new BAR size would pass the iATU untranslated, which could allow the host to read memory not belonging to the new struct pci_epf_bar.
While at it, add comments which clarifies the support for dynamically changing the physical address of a BAR. (Which was also missing.)
If you want to get best quality of vulnerability data, you may have to visit VulDB.
Analysis
by VulDB Data Team • 05/24/2026
The vulnerability CVE-2024-58006 affects the Linux kernel's PCI designware endpoint controller implementation, specifically within the dwc (Designware Controller) subsystem. This issue resides in the pci_epc_set_bar() function which manages the configuration of PCI Endpoint Function (EPF) Base Address Registers. The flaw emerged from a previous commit that introduced functionality to dynamically modify the backing physical address of already configured BARs without requiring intermediate clear_bar() calls. This change was intended to support flexible address mapping but introduced a critical security gap by removing essential validation checks for BAR size and flag modifications.
The technical implementation flaw occurs when the set_bar() function processes BAR configuration updates without validating that new size and flag parameters match existing configurations. When a BAR's physical address is updated dynamically, the system must ensure that the new address translation range aligns with the previously assigned BAR size as determined by the host controller. This alignment is crucial because without proper validation, a new BAR size that is smaller than the host-determined size creates a security vulnerability where memory access beyond the new BAR boundaries could bypass the iATU (intermediate address translation unit) and access unauthorized memory regions. The vulnerability represents a direct violation of memory isolation principles and could enable privilege escalation or information disclosure attacks.
The operational impact of this vulnerability extends across systems utilizing PCI designware endpoint controllers, particularly those implementing PCIe endpoint functionality in embedded systems, network devices, and storage controllers. Attackers could potentially exploit this flaw to gain unauthorized access to memory regions that should be restricted to specific endpoint functions. The vulnerability is particularly concerning in environments where endpoint functions handle sensitive data or operate with elevated privileges. According to CWE-129, this represents an inadequate input validation issue where the system fails to properly validate the size and attributes of memory regions, while the ATT&CK framework would classify this under privilege escalation techniques through memory corruption or access control bypass.
The recommended mitigation strategy involves implementing strict validation checks within the set_bar() function to ensure that any BAR size or flag modifications maintain consistency with existing configurations. This requires adding comprehensive parameter validation before allowing BAR updates to proceed. System administrators should update to kernel versions containing the fix, which includes both the validation checks and improved documentation clarifying the dynamic address changing support. Organizations implementing PCIe endpoint functionality should also conduct security assessments to identify any potential exploitation vectors in their existing deployments. The fix addresses the core issue by preventing modifications that could create address translation mismatches while maintaining the legitimate functionality for dynamic address updates when configuration parameters remain consistent.