CVE-2024-42302
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.
| Package | Ecosystem | Fixed in |
|---|---|---|
| kernel-libbpf | Amazon Linux | 6.1.106-116.188.amzn2023 |
| bpftool | Amazon Linux | 6.1.106-116.188.amzn2023 |
| kernel-libbpf-devel | Amazon Linux | 6.1.106-116.188.amzn2023 |
| kernel-modules-extra | Amazon Linux | 6.1.106-116.188.amzn2023 |
| kernel-modules-extra-common | Amazon Linux | 6.1.106-116.188.amzn2023 |
| kernel-devel | Amazon Linux | 6.1.106-116.188.amzn2023 |
| perf | Amazon Linux | 6.1.106-116.188.amzn2023 |
| kernel-headers | Amazon Linux | 6.1.106-116.188.amzn2023 |
| kernel | Amazon Linux | 6.1.106-116.188.amzn2023 |
| kernel-libbpf-static | Amazon Linux | 6.1.106-116.188.amzn2023 |
| python3-perf | Amazon Linux | 6.1.106-116.188.amzn2023 |
| linux_kernel | linux | 6.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
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | d0292124bb5787a2f1ab1316509e801ca89c10fb, ffe2318405e605f1b3985ce188eff69e6d1d1baa, 189f856e76f5463f59efb5fc18dcc1692d04c41a |
| Linux | Linux | 6.3, 0, 5.10.224 |
| amazon:2023 | kernel-libbpf | 0 |
| amazon:2023 | bpftool | 0 |
| amazon:2023 | kernel-libbpf-devel | 0 |
| Siemens | SIMATIC S7-1500 TM MFP - GNU/Linux subsystem | 0 |
| amazon:2023 | kernel-modules-extra | 0 |
| amazon:2023 | kernel-modules-extra-common | 0 |
| amazon:2023 | kernel-devel | 0 |
| amazon:2023 | perf | 0 |
| amazon:2023 | kernel-headers | 0 |
| amazon:2023 | kernel | 0 |
| amazon:2023 | kernel-libbpf-static | 0 |
| amazon:2023 | python3-perf | 0 |
| Linux | Linux | 6.2.3, 6.1.103, 6.6.44 |
| amazon:2023 | kernel-livepatch-6.1.106-116.188 | 0 |
| amazon:2023 | kernel-tools-devel | 0 |
| linux | linux_kernel | 5.10.176, 6.1.16, 6.3 |
| amazon:2023 | kernel-tools | 0 |
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