CVE-2024-35809
PCI/PM: Drain runtime-idle callbacks before driver removal
Reported by linux · Published May 17, 2024
In the Linux kernel, the following vulnerability has been resolved: PCI/PM: Drain runtime-idle callbacks before driver removal A race condition between the .runtime_idle() callback and the .remove() callback in the rtsx_pcr PCI driver leads to a kernel crash due to an unhandled page fault [1]. The problem is that rtsx_pci_runtime_idle() is not expected to be running after pm_runtime_get_sync() has been called, but the latter doesn't really guarantee that. It only guarantees that the suspend and resume callbacks will not be running when it returns. However, if a .runtime_idle() callback is already running when pm_runtime_get_sync() is called, the latter will notice that the runtime PM status of the device is RPM_ACTIVE and it will return right away without waiting for the former to complete. In fact, it cannot wait for .runtime_idle() to complete because it may be called from that callback (it arguably does not make much sense to do that, but it is not strictly prohibited). Thus in general, whoever is providing a .runtime_idle() callback needs to protect it from running in parallel with whatever code runs after pm_runtime_get_sync(). [Note that .runtime_idle() will not start after pm_runtime_get_sync() has returned, but it may continue running then if it has started earlier.] One way to address that race condition is to call pm_runtime_barrier() after pm_runtime_get_sync() (not before it, because a nonzero value of the runtime PM usage counter is necessary to prevent runtime PM callbacks from being invoked) to wait for the .runtime_idle() callback to complete should it be running at that point. A suitable place for doing that is in pci_device_remove() which calls pm_runtime_get_sync() before removing the driver, so it may as well call pm_runtime_barrier() subsequently, which will prevent the race in question from occurring, not just in the rtsx_pcr driver, but in any PCI drivers providing .runtime_idle() callbacks.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| bpftool | Amazon Linux | 6.1.84-99.169.amzn2023 |
| perf | Amazon Linux | 4.14.345-262.561.amzn2 |
| kernel-livepatch-6.1.84-99.169 | Amazon Linux | 1.0-0.amzn2023 |
| kernel-modules-extra | Amazon Linux | 6.1.84-99.169.amzn2023 |
| kernel-libbpf-devel | Amazon Linux | 6.1.84-99.169.amzn2023 |
| SIMATIC S7-1500 CPU 1518-4 PN/DP MFP | Siemens | 3.1.5 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | f3ec4f87d607f40497afdb5ac03f11e2ea253d52, f3ec4f87d607f40497afdb5ac03f11e2ea253d52, f3ec4f87d607f40497afdb5ac03f11e2ea253d52 |
| Linux | Linux | 2.6.36, 0, 4.19.312 |
| amazon:2023 | bpftool | 0 |
| amazon:2 | perf | 0 |
| amazon:2023 | kernel-livepatch-6.1.84-99.169 | 0 |
| amazon:2023 | kernel-modules-extra | 0 |
| Siemens | SIMATIC S7-1500 CPU 1518-4 PN/DP MFP | 3.1.0 |
| amazon:2023 | kernel-libbpf-devel | 0 |
| Linux | Linux | *, *, 6.1.84 |
| amazon:2 | kernel-tools-devel | 0 |
| amazon:2023 | kernel-libbpf-static | 0 |
| amazon:2 | kernel-headers | 0 |
| amazon:2023 | kernel | 0 |
| amazon:2023 | kernel-devel | 0 |
| amazon:2 | kernel-livepatch-4.14.345-262.561 | 0 |
| Siemens | SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP | 3.1.0 |
| amazon:2 | python-perf | 0 |
| amazon:2023 | kernel-modules-extra-common | 0 |
| amazon:2023 | kernel-headers | 0 |
| amazon:2023 | perf | 0 |
…and 9 more
Timeline
- May 17, 2024 CVE Published
- May 18, 2024 EPSS Score (30 in total, the first dated here)
- Oct 4, 2024 Coalition ESS Score (11 in total, the first dated here)
- Dec 16, 2025 PoC Published
- Jan 10, 2026 Security Advisory (467 in total, the first dated here)
- Mar 30, 2026 Distribution Patch (362 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-35809
vulnetix vdb fixes CVE-2024-35809
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-35809/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart