CVE-2024-58006: PCI: dwc: ep: Prevent changing BAR size/flags in pci_epc_set_bar()
In the Linux kernel, the following vulnerability has been resolved:
PCI: dwc: ep: Prevent changing BAR size/flags in pciepcsetbar()
In commit 4284c88fff0e ("PCI: designware-ep: Allow pciepcsetbar() update inbound map address") setbar() was modified to support dynamically changing the backing physical address of a BAR that was already configured.
This means that setbar() can be called twice, without ever calling clearbar() (as calling clearbar() 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 setbar() 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 pciepfbar.
While at it, add comments which clarifies the support for dynamically changing the physical address of a BAR. (Which was also missing.)
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2024-58006?
CVE-2024-58006 has a medium severity rating due to potential privilege escalation risks.
How do I fix CVE-2024-58006?
To fix CVE-2024-58006, update your Linux kernel to version 6.12.14 or later, or version 6.13.3 or later.
Which versions of the Linux kernel are affected by CVE-2024-58006?
CVE-2024-58006 affects Linux kernel versions between 6.0 and 6.12.14, as well as versions between 6.13 and 6.13.3.
What is the impact of CVE-2024-58006 on system security?
CVE-2024-58006 can lead to unauthorized changes to PCI Express endpoint configurations, potentially allowing privilege escalation.
Is there a workaround for CVE-2024-58006?
There is no known workaround for CVE-2024-58006; the recommended action is to apply the appropriate kernel update.