On 11/17/26 03:50, Lukas Wunner wrote:
> On Tue, Nov 17, 2026 at 12:10:29PM +0100, Pierre Gondois wrote:
>> Return PCI_ERS_RESULT_DISCONNECT when no upstream bridge is available,
>> avoiding a NULL pointer dereference in pci_walk_bridge().
> 
> How can that happen?  If it can happen (which I doubt), why isn't this
> patch tagged for stable?

One way I can see is a device without a PCIe capability on a root bus.
pci_pcie_type() returns 0, which is PCI_EXP_TYPE_ENDPOINT, and
pci_upstream_bridge() returns NULL. Native AER never gets there. Only
firmware-first can, through aer_recover_work_func(), and only if
firmware reports a PCIe error section for such a device. If that is
the case, skipping recovery for !pci_is_pcie(pdev) in
aer_recover_work_func() seems a better fit than a check in
pcie_do_recovery().

> 
> Why is it at the end of this series?  Does the series somehow make it
> possible that there's no upstream bridge?  Which patch does that?
> If the preceding patches are not the cause of a potential NULL
> pointer deref, why isn't this patch submitted separately from the series?
> 
> Thanks,
> 
> Lukas

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer


Reply via email to