VDB

CVE-2024-35809

CVE-2024-35809 PUBLISHED CVSS 5.5 MEDIUM

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.

PackageEcosystemFixed in
bpftoolAmazon Linux6.1.84-99.169.amzn2023
perfAmazon Linux4.14.345-262.561.amzn2
kernel-livepatch-6.1.84-99.169Amazon Linux1.0-0.amzn2023
kernel-modules-extraAmazon Linux6.1.84-99.169.amzn2023
kernel-libbpf-develAmazon Linux6.1.84-99.169.amzn2023
SIMATIC S7-1500 CPU 1518-4 PN/DP MFPSiemens3.1.5

Risk scores

CVSS 3.1
5.5
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Affected products

VendorProductVersions
LinuxLinuxf3ec4f87d607f40497afdb5ac03f11e2ea253d52, f3ec4f87d607f40497afdb5ac03f11e2ea253d52, f3ec4f87d607f40497afdb5ac03f11e2ea253d52
LinuxLinux2.6.36, 0, 4.19.312
amazon:2023bpftool0
amazon:2perf0
amazon:2023kernel-livepatch-6.1.84-99.1690
amazon:2023kernel-modules-extra0
SiemensSIMATIC S7-1500 CPU 1518-4 PN/DP MFP3.1.0
amazon:2023kernel-libbpf-devel0
LinuxLinux*, *, 6.1.84
amazon:2kernel-tools-devel0
amazon:2023kernel-libbpf-static0
amazon:2kernel-headers0
amazon:2023kernel0
amazon:2023kernel-devel0
amazon:2kernel-livepatch-4.14.345-262.5610
SiemensSIMATIC S7-1500 CPU 1518F-4 PN/DP MFP3.1.0
amazon:2python-perf0
amazon:2023kernel-modules-extra-common0
amazon:2023kernel-headers0
amazon:2023perf0

…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

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