CVE-2026-139503: PCI/AER: Fix struct pci_dev reference leak in aer_process_err_devices()
In the Linux kernel, the following vulnerability has been resolved:
PCI/AER: Fix struct pcidev reference leak in aerprocesserrdevices()
When an AER error occurs, candidate error-source devices are added to einfo->dev[] by adderrordevice(), which takes a reference with pcidevget().
A device can be recorded without any error status being present: the Requester ID fast path in iserrorsource(),
if (einfo->id == pcidevid(dev)) return true;
matches purely on the ID reported by the Root Port and returns true without reading the device's AER status registers.
In aerprocesserrdevices(), handleerrorsource() is called only if aergetdeviceerrorinfo() returns non-zero, i.e. only if an unmasked error status bit is actually set. It returns 0 if the device has become inaccessible (status and mask both read as all ones, so status & ~mask == 0) or if no unmasked status bit is set.
Because handleerrorsource() was responsible for calling pcidevput(), skipping it permanently leaks the reference taken in adderrordevice().
Decouple reference lifetime from error handling by moving pcidevput() out of handleerrorsource() and into the aerprocesserrdevices() loop, so every recorded device is put exactly once.
handleerrorsource() is static and aerprocesserrdevices() is its only caller, so no other path is affected.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Move pci_dev_put() out of handle_error_source() and into the aer_process_err_devices() loop so every device recorded by add_error_device() is put exactly once, including when handle_error_source() is skipped.