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

Published Aug 17, 2024
·
Updated

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 dpchandler() 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 pcidev cause the kernel to oops.

That's because pcibridgewaitforsecondarybus() 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 resumenoirq phase. And runtime resume is always awaited before a PCI device is removed.)

However starting with v6.3, pcibridgewaitforsecondarybus() 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 pcibridgewaitforsecondarybus() now needs to hold a reference on the child device because dpchandler() 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: pcibusreadconfigdword+0x17/0x50 pcidevwait() pcibridgewaitforsecondarybus() dpcresetlink() pciedorecovery() dpchandler()

Other sources

This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.

Launchpad

Affected Software

17 affected componentsFixes available
Linux Linux kernel<5.10.224
Linux Linux kernel>=5.11<5.15.165
Linux Linux kernel>=5.16<6.1.103
Linux Linux kernel>=6.2<6.6.44
Linux Linux kernel>=6.7<6.10.3
debian/linux<=5.10.223-1
5.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1
debian/linux-6.1
6.1.129-1~deb11u1
Microsoft azl3 kernel 6.6.43.1-7
Microsoft cbl2 kernel 5.15.164.1-1
Microsoft cbl2 kernel 5.15.167.1-1
Microsoft cbl2 kernel 5.15.164.1-1
Microsoft azl3 kernel 6.6.47.1-1
Debian Debian Linux=11.0
Linux Linux kernel>=5.10.176<5.10.224
Linux Linux kernel>=5.15.104<5.15.165
Linux Linux kernel>=6.1.16<6.1.103
Linux Linux kernel>=6.2.3<6.6.44

Event History

Aug 17, 2024
CVE Published
via MITRE·09:09 AM
Data Sourced
via MITRE·09:09 AM
Description
Data Sourced
via NVD·09:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Sep 11, 2024
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
DescriptionSeverity
Updated
via Microsoft·07:00 AM
Description
Nov 11, 2024
Data Sourced
via Launchpad·03:47 PM
Description
May 3, 2025
Data Sourced
via Ubuntu·06:22 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-42302?

CVE-2024-42302 is classified as a medium-severity vulnerability due to the potential for use-after-free conditions.

2

How do I fix CVE-2024-42302?

To resolve CVE-2024-42302, upgrade to the Linux kernel versions 5.10.226, 6.1.123, or later.

3

Which Linux kernel versions are affected by CVE-2024-42302?

CVE-2024-42302 affects Linux kernel versions up to 5.10.224 and several other versions within specific ranges.

4

What is a use-after-free vulnerability in CVE-2024-42302?

In CVE-2024-42302, the use-after-free vulnerability occurs during concurrent handling of a DPC and hot-removal of hardware.

5

Is there a patch available for CVE-2024-42302?

Yes, patches for CVE-2024-42302 are included in the recommended updates for affected Linux kernel versions.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203