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-58002 Overview
CVE-2024-58002 is a use-after-free vulnerability [CWE-416] in the Linux kernel's uvcvideo driver, which supports USB Video Class devices such as webcams. When userspace writes an asynchronous control, the driver stores a pointer to the originating file handle for later notification. If the user closes the file descriptor before the device completes the operation, the file handle structure is freed while the driver retains dangling pointers to it.
A local, authenticated attacker with access to a UVC device can trigger memory corruption, resulting in loss of confidentiality, integrity, and availability on the affected host.
Critical Impact
Local attackers with access to a UVC video device can trigger a use-after-free in the kernel, potentially leading to privilege escalation or kernel memory corruption on affected Linux systems.
Affected Products
- Linux kernel versions prior to the fixes shipped in commits 221cd51efe45, 438bda062b2c, 4dbaa738c583, and 9edc7d25f7e4
- Debian LTS distributions (addressed in advisories DLA-2025 msg00030 and msg00045)
- Siemens industrial products running affected Linux kernels (per Siemens advisory SSA-784472)
Discovery Timeline
- 2025-02-27 - CVE-2024-58002 published to the National Vulnerability Database
- 2026-10-15 - Last updated in NVD database
Technical Details for CVE-2024-58002
Vulnerability Analysis
The uvcvideo driver supports USB Video Class devices and exposes asynchronous controls through the Video4Linux2 (V4L2) interface. When a userspace process writes an async control via an ioctl on an open device file descriptor, the driver saves a pointer to the originating struct v4l2_fh file handle. This pointer is used later to deliver completion events once the USB device responds.
The lifetime of the saved pointer is not bound to the lifetime of the file handle. If the process closes the file descriptor while an async control operation is still pending, the kernel releases the v4l2_fh structure, but the driver retains the stale reference. When the device later completes the operation, the driver dereferences the freed memory, producing a classic use-after-free condition.
Root Cause
The root cause is missing cleanup of pending async control references during the driver's release() path. The driver tracked outstanding async operations only implicitly, and the release() handler did not scan for and invalidate pointers to the departing file handle. The upstream fix introduces a counter that tracks pending async operations and adds logic to clear dangling pointers during release, while avoiding overhead in the common synchronous case.
Attack Vector
Exploitation requires local access and the ability to open a UVC device node such as /dev/videoN. The attacker issues an async control write through V4L2 ioctl interfaces, then closes the file descriptor before the USB device completes the request. The subsequent kernel-side callback dereferences freed memory. With heap grooming techniques, an attacker can arrange for attacker-controlled data to occupy the freed slab object, enabling kernel memory corruption and potential privilege escalation.
No verified proof-of-concept code is published. Technical details are available in the upstream Linux kernel commits referenced in the Linux Kernel Commit 221cd51efe4 and related patches.
Detection Methods for CVE-2024-58002
Indicators of Compromise
- Kernel oops, warning, or panic messages originating from uvc_ctrl_status_event_work or related uvcvideo call paths in dmesg or /var/log/kern.log
- KASAN (Kernel Address Sanitizer) use-after-free reports naming v4l2_fh or uvc_fh objects on kernels built with KASAN
- Unexpected process crashes or kernel task hangs following rapid open/close cycles against /dev/video* nodes
Detection Strategies
- Audit installed kernel package versions against distribution advisories such as the Debian LTS Announcement #30 and Debian LTS Announcement #45
- Monitor process behavior for unprivileged users repeatedly opening V4L2 device nodes and issuing async control ioctl calls followed by immediate close()
- Review endpoint telemetry for kernel crash events on hosts with USB camera hardware
Monitoring Recommendations
- Centralize dmesg and kernel audit logs for correlation across the fleet to detect uvcvideo fault patterns
- Alert on repeated access to /dev/video* by non-media userspace processes using Linux auditd rules on the open and ioctl syscalls
- Track kernel version inventory to confirm patch deployment coverage on Linux endpoints and embedded devices
How to Mitigate CVE-2024-58002
Immediate Actions Required
- Apply vendor-supplied kernel updates from your Linux distribution as soon as they are available
- For Siemens industrial customers, review Siemens Security Advisory SSA-784472 and apply the recommended firmware updates
- Restrict access to /dev/video* device nodes to trusted users and services using group permissions or udev rules
- Reboot affected systems after kernel package upgrades to activate the patched kernel
Patch Information
The fix is upstream in the Linux kernel across multiple stable branches. Relevant commits include Linux Kernel Commit 221cd51efe4, Linux Kernel Commit 438bda062b2c, Linux Kernel Commit 4dbaa738c583, and Linux Kernel Commit 9edc7d25f7e4. Debian users should install updates referenced in the Debian LTS announcements above.
Workarounds
- Unload the uvcvideo kernel module on systems that do not require USB webcam functionality using modprobe -r uvcvideo and blacklist it in /etc/modprobe.d/
- Tighten permissions on /dev/video* nodes so only authorized users can open UVC devices
- Physically disconnect USB cameras on systems that cannot be patched immediately in sensitive environments
# Blacklist the uvcvideo module to disable the vulnerable code path
echo "blacklist uvcvideo" | sudo tee /etc/modprobe.d/disable-uvcvideo.conf
sudo modprobe -r uvcvideo
# Restrict access to V4L2 device nodes to the video group
sudo chown root:video /dev/video*
sudo chmod 660 /dev/video*
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

