VDB

CVE-2024-42302

CVE-2024-42302 PUBLISHED

PCI/DPC: Fix use-after-free on concurrent DPC and hot-removal

Reported by linux · Published August 17, 2024

In the Linux kernel, the following vulnerability has been resolved: PCI/DPC: Fix use-after-free on concurrent DPC and hot-removal Keith reports a use-after-free when a DPC event occurs concurrently to hot-removal of the same portion of the hierarchy: The dpc_handler() awaits readiness of the secondary bus below the Downstream Port where the DPC event occurred. To do so, it polls the config space of the first child device on the secondary bus. If that child device is concurrently removed, accesses to its struct pci_dev cause the kernel to oops. That's because pci_bridge_wait_for_secondary_bus() neglects to hold a reference on the child device. Before v6.3, the function was only called on resume from system sleep or on runtime resume. Holding a reference wasn't necessary back then because the pciehp IRQ thread could never run concurrently. (On resume from system sleep, IRQs are not enabled until after the resume_noirq phase. And runtime resume is always awaited before a PCI device is removed.) However starting with v6.3, pci_bridge_wait_for_secondary_bus() is also called on a DPC event. Commit 53b54ad074de ("PCI/DPC: Await readiness of secondary bus after reset"), which introduced that, failed to appreciate that pci_bridge_wait_for_secondary_bus() now needs to hold a reference on the child device because dpc_handler() and pciehp may indeed run concurrently. The commit was backported to v5.10+ stable kernels, so that's the oldest one affected. Add the missing reference acquisition. Abridged stack trace: BUG: unable to handle page fault for address: 00000000091400c0 CPU: 15 PID: 2464 Comm: irq/53-pcie-dpc 6.9.0 RIP: pci_bus_read_config_dword+0x17/0x50 pci_dev_wait() pci_bridge_wait_for_secondary_bus() dpc_reset_link() pcie_do_recovery() dpc_handler()

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
kernel-libbpfAmazon Linux6.1.106-116.188.amzn2023
bpftoolAmazon Linux6.1.106-116.188.amzn2023
kernel-libbpf-develAmazon Linux6.1.106-116.188.amzn2023
kernel-modules-extraAmazon Linux6.1.106-116.188.amzn2023
kernel-modules-extra-commonAmazon Linux6.1.106-116.188.amzn2023
kernel-develAmazon Linux6.1.106-116.188.amzn2023
perfAmazon Linux6.1.106-116.188.amzn2023
kernel-headersAmazon Linux6.1.106-116.188.amzn2023
kernelAmazon Linux6.1.106-116.188.amzn2023
kernel-libbpf-staticAmazon Linux6.1.106-116.188.amzn2023
python3-perfAmazon Linux6.1.106-116.188.amzn2023
linux_kernellinux6.10.3, 6.6.44, 6.1.103, 5.15.165, 5.10.224

2 more packages have a fixed version. See every fix in Lookup.

Affected products

VendorProductVersions
LinuxLinuxd0292124bb5787a2f1ab1316509e801ca89c10fb, ffe2318405e605f1b3985ce188eff69e6d1d1baa, 189f856e76f5463f59efb5fc18dcc1692d04c41a
LinuxLinux6.3, 0, 5.10.224
amazon:2023kernel-libbpf0
amazon:2023bpftool0
amazon:2023kernel-libbpf-devel0
SiemensSIMATIC S7-1500 TM MFP - GNU/Linux subsystem0
amazon:2023kernel-modules-extra0
amazon:2023kernel-modules-extra-common0
amazon:2023kernel-devel0
amazon:2023perf0
amazon:2023kernel-headers0
amazon:2023kernel0
amazon:2023kernel-libbpf-static0
amazon:2023python3-perf0
LinuxLinux6.2.3, 6.1.103, 6.6.44
amazon:2023kernel-livepatch-6.1.106-116.1880
amazon:2023kernel-tools-devel0
linuxlinux_kernel5.10.176, 6.1.16, 6.3
amazon:2023kernel-tools0

Timeline

  • Aug 17, 2024 CVE Published
  • Aug 18, 2024 EPSS Score (30 in total, the first dated here)
  • Oct 4, 2024 Coalition ESS Score (24 in total, the first dated here)
  • Jan 6, 2025 CVE Updated
  • Dec 16, 2025 PoC Published
  • Jan 6, 2026 Security Advisory (141 in total, the first dated here)
  • Mar 30, 2026 Distribution Patch (127 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2024-42302
vulnetix vdb fixes CVE-2024-42302

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-42302/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›