CyberSecBulletin
CVE-2024-42302NVD status: Modified

Linux: Use After Free

CVE-2024-42302 is a high-severity use after free vulnerability in Linux, with a CVSS 3.1 base score of 7.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. The record lists versions c52f9e1a9eb40f13993142c331a6cfd334d4b91d, 2c111413f38ca5cf87557cab89f6d82b0e3433e7, f63df70b439bb8331358a306541893bf415bf1da as the first without the flaw, so updating Linux to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.23% chance of exploitation within 30 days, which is low compared with other CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Linux to c52f9e1a9eb40f13993142c331a6cfd334d4b91d or 2c111413f38ca5cf87557cab89f6d82b0e3433e7 or f63df70b439bb8331358a306541893bf415bf1da or 2cc8973bdc4d6c928ebe38b88090a2cdfe81f42f, whichever matches your release line, or a later version.
  2. Update SIMATIC S7-1500 TM MFP - GNU/Linux subsystem to V1.1.1 or a later version.
  3. Update Linux Kernel to 5.10.224 or 5.15.165 or 6.1.103 or 6.6.44, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinuxd0292124bb5787a2f1ab1316509e801ca89c10fb up to, but not including, c52f9e1a9eb40f13993142c331a6cfd334d4b91d; ffe2318405e605f1b3985ce188eff69e6d1d1baa up to, but not including, 2c111413f38ca5cf87557cab89f6d82b0e3433e7; 189f856e76f5463f59efb5fc18dcc1692d04c41a up to, but not including, f63df70b439bb8331358a306541893bf415bf1da; 53b54ad074de1896f8b021615f65b27f557ce874 up to, but not including, 2cc8973bdc4d6c928ebe38b88090a2cdfe81f42f; 53b54ad074de1896f8b021615f65b27f557ce874 up to, but not including, b16f3ea1db47a6766a9f1169244cf1fc287a7c62; 53b54ad074de1896f8b021615f65b27f557ce874 up to, but not including, 11a1f4bc47362700fcbde717292158873fb847ed; 0081032082b5b45ca902b3c3d6986cb5cca69ff2; 5.10.176 up to, but not including, 5.10.224; and 4 more rangesc52f9e1a9eb40f13993142c331a6cfd334d4b91d, 2c111413f38ca5cf87557cab89f6d82b0e3433e7, f63df70b439bb8331358a306541893bf415bf1da, 2cc8973bdc4d6c928ebe38b88090a2cdfe81f42f, b16f3ea1db47a6766a9f1169244cf1fc287a7c62, 11a1f4bc47362700fcbde717292158873fb847ed
SiemensSIMATIC S7-1500 TM MFP - GNU/Linux subsystembefore V1.1.1V1.1.1
DebianDebian Linux11.0Not stated
LinuxLinux Kernel5.10.176 up to, but not including, 5.10.224; 5.15.104 up to, but not including, 5.15.165; 6.1.16 up to, but not including, 6.1.103; 6.2.3 up to, but not including, 6.6.44; 6.7 up to, but not including, 6.10.35.10.224, 5.15.165, 6.1.103, 6.6.44, 6.10.3

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
LocalThe attacker needs local access or must trick a user into running something.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
LowA basic user account is enough.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.

Official description

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()

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Use After Free

The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory belongs to the code that operates on the new pointer.

How developers prevent this class of flaw

  • Choose a language that provides automatic memory management.
  • When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures may lower the usefulness of this strategy.

More Use After Free vulnerabilities (CWE-416)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
  3. Record last changed materially (score, affected products, status or references).

References

Third-party and government advisories

Recent Use After Free vulnerabilities

Spotted an error? Tell us.