PCI: altera: Fix resource leaks on probe failure
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c63aed7334c21de8d626ff028ccad98cf5847a0e · < 09c43b7b7d29c6fadb27f32cdf7f3bb6598befa9| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
PCI: altera: Fix resource leaks on probe failure
The chained IRQ handler is set during probe, but is only removed during the driver remove(). If pci_host_probe() fails, the handler and INTx IRQ domain remain set even though the devm-managed host bridge storage containing struct altera_pcie will be released, leaving the handler with a stale data pointer.
Interrupts are also enabled before pci_host_probe() is called. If probe fails after that point, the controller interrupt source should be disabled before the chained handler and INTx domain are removed.
So set the chained handler only after the INTx domain has been created. Disable controller interrupts during IRQ teardown, and tear the IRQ setup down if pci_host_probe() fails.
[mani: commit log]
From the CVE record · Linux
The Linux kernel’s Altera PCI driver can leave an IRQ handler pointing to freed storage if PCI host probing fails. A subsequent interrupt could reach the stale pointer; the input does not specify an attacker path, authentication requirements, or user interaction.
Engineers running Linux kernels with the Altera PCI driver should check their builds; affected versions are not specified.