Skip to main content
Vulnerability Database/CVE-2024-58093

CVE-2024-58093: Linux Kernel Use-After-Free Vulnerability

CVE-2024-58093 is a use-after-free vulnerability in the Linux Kernel PCI/ASPM subsystem that can cause system crashes during device removal. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-58093 Overview

CVE-2024-58093 is a use-after-free vulnerability [CWE-416] in the Linux kernel's PCI Active State Power Management (ASPM) subsystem. The flaw affects the link state teardown logic during removal of multifunction devices (MFD) on a PCIe switch upstream port. A prior fix (456d8aa37d0f) that disabled ASPM on MFD function removal freed the parent link too early, leaving dangling parent_link references on remaining downstream ports.

Triggering the issue produces general protection faults (GPFs), observed frequently during hot-unplug operations where pciehp removes devices in reverse order. The resolved patch frees the ASPM link exactly when function 0, the virtual P2P bridge to the internal bus, is removed.

Critical Impact

Local attackers with low privileges and physical or administrative access to PCIe hot-plug operations can trigger a kernel use-after-free, enabling denial of service or potential local privilege escalation.

Affected Products

  • Linux kernel versions containing commit 456d8aa37d0f ("PCI/ASPM: Disable ASPM on MFD function removal to avoid use-after-free") prior to the fix
  • Distributions shipping affected stable kernel branches referenced in the upstream patch series
  • Systems with PCIe switches exposing multifunction devices on upstream ports

Discovery Timeline

  • 2025-04-16 - CVE-2024-58093 published to NVD
  • 2026-07-16 - Last updated in NVD database

Technical Details for CVE-2024-58093

Vulnerability Analysis

The defect lives in the PCI ASPM link lifecycle management code. ASPM link state objects track power-management relationships between a PCIe switch upstream port and its downstream ports. Each downstream link holds a parent_link pointer referencing the upstream link.

Before commit 456d8aa37d0f, the kernel freed an ASPM link only after the last function on the pertinent bus was removed. If function 0 was removed before its siblings, link->downstream pointed to freed memory. The subsequent fix moved the free to occur on any function removal, which is premature when the link is to a PCIe switch with MFD on the upstream port. Removing non-zero functions first freed a link still referenced as parent_link by remaining downstream ports.

Root Cause

The root cause is incorrect lifetime management of the ASPM link object relative to multifunction device teardown on PCIe switch upstream ports. The fix frees the link precisely when function 0, the virtual P2P bridge to the internal bus, is removed. At that point the parent link is not yet obsolete, but all subordinate links are already gone, resolving the dangling pointer window.

Attack Vector

Exploitation requires local access with low privileges. The attacker must induce PCIe hot-unplug events on a system with an affected PCIe switch topology, or trigger the removal path through supported administrative interfaces. The resulting GPF typically produces a kernel oops, with memory corruption primitives possible depending on allocator state and heap layout.

No verified public proof-of-concept code is available. Technical reviewers should consult the upstream patches referenced in the Kernel Git Commit cbf937d and related commits for exact code paths.

Detection Methods for CVE-2024-58093

Indicators of Compromise

  • Kernel log entries showing general protection faults (GPF) in PCI ASPM code paths, especially during PCIe hot-unplug operations
  • Call traces referencing pcie_aspm_exit_link_state, pcie_update_aspm_capable, or pciehp device removal routines
  • Unexpected kernel panics on systems with PCIe switches hosting multifunction devices

Detection Strategies

  • Correlate kernel crash telemetry with PCI subsystem events to identify ASPM-related faults
  • Audit installed kernel versions against the fixed commits listed in the vendor advisories to confirm patch status
  • Monitor hot-plug operations on PCIe switch topologies for abnormal frequency or scripted triggers

Monitoring Recommendations

  • Forward dmesg and /var/log/kern.log to a centralized log platform for crash-pattern analysis
  • Alert on repeated pciehp removal events combined with kernel oops output on the same host
  • Track package versions of installed kernels through configuration-management tooling to flag unpatched hosts

How to Mitigate CVE-2024-58093

Immediate Actions Required

  • Inventory Linux hosts with PCIe switches exposing multifunction devices, including servers using NVMe switches, Thunderbolt, and GPU complexes
  • Apply the stable kernel update that includes the fix, matching the branch in use (see upstream commits)
  • Restrict local administrative access that can trigger PCIe hot-unplug or device removal operations

Patch Information

The fix was merged across multiple stable branches. Reference commits include Kernel Git Commit cbf937d, Kernel Git Commit 0a0f9ae, Kernel Git Commit 4d96930, Kernel Git Commit 62db339, Kernel Git Commit 8b930dd, Kernel Git Commit ba4cdc1, Kernel Git Commit cd4b075, Kernel Git Commit e5cd58f, and Kernel Git Commit f556b6b. Apply the vendor-provided kernel package that incorporates these commits and reboot into the patched image.

Workarounds

  • Disable PCIe ASPM at boot time by appending pcie_aspm=off to the kernel command line where power savings can be sacrificed
  • Avoid hot-unplug operations on PCIe switches with multifunction upstream ports until the patched kernel is deployed
  • Limit CAP_SYS_ADMIN and physical access on affected systems to reduce the probability of triggering the vulnerable code path
bash
# Verify running kernel version and ASPM policy
uname -r
cat /sys/module/pcie_aspm/parameters/policy

# Optional: disable ASPM via kernel command line (requires reboot)
# Edit /etc/default/grub and append pcie_aspm=off to GRUB_CMDLINE_LINUX
sudo update-grub && sudo reboot

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.