Revert "PCI/MSI: Unmap MSI-X region on error"
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1a8d4c6ecb4c81261bcdf13556abd4a958eca202 · < f64e03da0d83cb173743888bff4a7e61476a8fc2| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
Revert "PCI/MSI: Unmap MSI-X region on error"
This reverts commit 1a8d4c6ecb4c81261bcdf13556abd4a958eca202.
Commit 1a8d4c6ecb4c ("PCI/MSI: Unmap MSI-X region on error") added an iounmap(dev->msix_base) on the error path of msix_capability_init() to release the MSI-X region when msix_setup_interrupts() fails.
When msix_setup_interrupts() fails, the call chain is:
msix_setup_interrupts() -> __msix_setup_interrupts() struct pci_dev *dev __free(free_msi_irqs) = __dev; ... return ret; // __free cleanup fires on error
The __free(free_msi_irqs) cleanup calls pci_free_msi_irqs(), which already handles the unmap:
void pci_free_msi_irqs(struct pci_dev *dev) { pci_msi_teardown_msi_irqs(dev); if (dev->msix_base) { iounmap(dev->msix_base); // already unmapped here dev->msix_base = NULL; // and set to NULL } }
From the CVE record · Linux
The Linux kernel’s PCI/MSI error path can call iounmap() a second time with a NULL pointer when MSI-X interrupt setup fails. This produced a kernel warning during a kexec self-test; the input does not describe an attacker path, authentication requirement, or user interaction.
Engineers running Linux kernels that include the affected PCI/MSI change should check their deployments; affected versions are not specified.