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

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

CVE-2024-46674 is a use-after-free flaw in the Linux Kernel USB DWC3 ST driver that causes unbalanced device reference counts. This post explains its technical details, affected versions, impact, and mitigation steps.

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-46674 Overview

CVE-2024-46674 is a use-after-free vulnerability [CWE-416] in the Linux kernel's USB DWC3 ST driver (drivers/usb/dwc3/dwc3-st.c). The flaw resides in the probe function's error path, which incorrectly executes undo_platform_dev_alloc logic even though the probe never allocates a platform device. This triggers an unbalanced reference count decrement on the probed platform device, leading to premature release of device resources. Subsequent cleanup of remaining devm-managed resources can then operate on freed memory. The vulnerability affects multiple stable Linux kernel branches, including the 6.11 release candidates. Debian issued LTS advisories addressing this issue in October 2024 and January 2025.

Critical Impact

A local, authenticated attacker who can trigger the DWC3 ST driver probe failure path may cause memory corruption, enabling denial of service or local privilege escalation on affected systems.

Affected Products

  • Linux kernel stable branches prior to the fix commits
  • Linux kernel 6.11-rc1 through 6.11-rc5
  • Debian distributions tracked in LTS advisories dated 2024-10 and 2025-01

Discovery Timeline

  • 2024-09-13 - CVE-2024-46674 published to the National Vulnerability Database
  • 2026-08-04 - Last updated in NVD database

Technical Details for CVE-2024-46674

Vulnerability Analysis

The defect lives in the st_dwc3_probe() function of the STMicroelectronics DWC3 USB controller glue driver. The probe routine registers child devices and configures the controller but does not call any platform device allocation API on the device passed to it. Despite this, the error path jumps to a label named undo_platform_dev_alloc that invokes platform_device_put() on the probed device.

Calling platform_device_put() on a device the driver did not allocate drops a reference the probe never acquired. This unbalanced put releases the underlying struct device prematurely while the kernel still holds pointers to it. When later cleanup paths release associated devm-managed resources, those operations dereference freed memory, satisfying the classic use-after-free pattern.

Root Cause

The root cause is a logical error in the probe error-handling flow. The label and corresponding cleanup were introduced on the assumption that the probe allocated a platform device, which it does not. The patch removes the bogus platform_device_put() call so the reference count on the probed device remains balanced across error paths.

Attack Vector

Exploitation requires local access with low privileges on a system using the DWC3 ST driver. An attacker who can influence conditions that cause the probe to fail, such as triggering driver rebind through sysfs or inducing resource acquisition failures, can force the error path to execute. The resulting dangling device reference may be reused by kernel subsystems that still hold pointers to the freed object, producing memory corruption suitable for privilege escalation in the kernel address space.

No public proof-of-concept is available, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog.

Detection Methods for CVE-2024-46674

Indicators of Compromise

  • Kernel oops or panic traces referencing dwc3-st, platform_device_put, or device_release during module probe or rebind
  • Unexpected driver rebind events against /sys/bus/platform/drivers/dwc3-st from unprivileged processes
  • KASAN or SLUB_DEBUG reports flagging use-after-free in platform device cleanup paths

Detection Strategies

  • Enable CONFIG_KASAN on test and staging kernels to surface use-after-free conditions in the DWC3 ST probe path during fuzzing
  • Audit the running kernel version against the fix commits (060f4124, 1de98966, 4c673529, 6aee4c56, b0979a88, ddfcfeba, e1e5e8ea, f3498650) referenced in the kernel.org stable tree
  • Correlate dmesg entries containing dwc3-st probe failures with subsequent kernel exceptions

Monitoring Recommendations

  • Forward kernel ring buffer logs to a centralized collector and alert on repeated DWC3 ST probe failures
  • Monitor sysfs write activity targeting platform driver bind and unbind attributes from non-root users
  • Track package versions on Debian systems against the fixed releases in the Debian LTS Announcement

How to Mitigate CVE-2024-46674

Immediate Actions Required

  • Apply the stable kernel update that includes the upstream fix removing the bogus undo_platform_dev_alloc label from dwc3-st.c
  • Prioritize patching embedded and SBC systems based on STMicroelectronics SoCs where the DWC3 ST driver is active
  • Restrict local shell access and non-administrator write access to platform driver sysfs attributes

Patch Information

The fix is distributed across multiple stable branches. Reference commits include 060f4124, 1de98966, 4c673529, 6aee4c56, b0979a88, ddfcfeba, e1e5e8ea, and f3498650. Debian users should update per the Debian LTS Announcement.

Workarounds

  • Blacklist the dwc3-st module on systems that do not require STMicroelectronics USB controller support
  • Remove or disable device tree bindings that bind the DWC3 ST driver on platforms where the controller is not needed
  • Limit interactive local access to trusted administrators until a patched kernel can be deployed

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.