CVE-2022-0487 Overview
A use-after-free vulnerability was discovered in the Linux kernel's memstick subsystem, specifically in the rtsx_usb_ms_drv_remove function located in drivers/memstick/host/rtsx_usb_ms.c. This flaw allows a local attacker with user privileges to impact system confidentiality by accessing memory that has already been freed.
Critical Impact
Local attackers with user-level privileges can exploit this use-after-free condition to leak sensitive kernel memory, potentially exposing confidential information from the affected system.
Affected Products
- Linux Kernel versions prior to 5.14 rc1
- Red Hat Enterprise Linux 8.0
- Debian Linux 9.0 and 11.0
Discovery Timeline
- 2022-02-04 - CVE-2022-0487 published to NVD
- 2024-11-21 - Last updated in NVD database
Technical Details for CVE-2022-0487
Vulnerability Analysis
This vulnerability is classified as CWE-416 (Use After Free), a memory corruption flaw that occurs when a program continues to use a pointer after the memory it references has been freed. In the context of the rtsx_usb_ms driver, the issue arises during the device removal routine where memory resources are improperly managed.
The vulnerable code path exists in the rtsx_usb_ms_drv_remove function, which is called when the USB memstick device is disconnected or the driver is unloaded. The flaw allows a local attacker to trigger a use-after-free condition, which can result in unauthorized access to kernel memory contents.
This vulnerability requires local access and user-level privileges to exploit. While it does not allow for integrity or availability impact, the confidentiality impact is significant as an attacker could potentially read sensitive data from kernel memory.
Root Cause
The root cause of this vulnerability lies in improper memory management within the rtsx_usb_ms_drv_remove function. When the driver removal routine is executed, memory resources are freed but references to that memory are not properly invalidated. This creates a dangling pointer that can be subsequently dereferenced, leading to access of freed memory regions.
The memstick host driver fails to properly synchronize the cleanup of resources during device removal, leaving a window where freed memory can still be accessed through existing references.
Attack Vector
The attack requires local access to a system with the vulnerable rtsx_usb_ms driver loaded. An attacker with user privileges can manipulate the USB memstick device removal process or trigger the driver unload sequence to exploit the use-after-free condition.
The exploitation mechanism involves the following sequence: the attacker initiates device removal or driver unload, the vulnerable rtsx_usb_ms_drv_remove function frees memory resources, and then the attacker accesses the freed memory through the dangling reference to read confidential kernel data.
Detection Methods for CVE-2022-0487
Indicators of Compromise
- Unexpected kernel memory access patterns or memory corruption warnings in system logs
- Unusual activity related to USB memstick device operations or driver loading/unloading
- Kernel oops or warnings referencing rtsx_usb_ms driver components
Detection Strategies
- Monitor kernel logs for use-after-free detection mechanisms (KASAN) triggering on the rtsx_usb_ms driver
- Audit USB device connection and disconnection events on sensitive systems
- Deploy kernel-level memory debugging tools to identify memory access violations in the memstick subsystem
Monitoring Recommendations
- Enable Kernel Address Sanitizer (KASAN) on development and testing systems to detect memory corruption
- Implement syslog monitoring for kernel warnings and errors related to memory management
- Use SentinelOne's kernel-level visibility to track suspicious driver behavior and memory access patterns
How to Mitigate CVE-2022-0487
Immediate Actions Required
- Update the Linux kernel to version 5.14 rc1 or later, which contains the security fix
- Apply vendor-specific patches from Red Hat or Debian as applicable to your distribution
- Consider blacklisting the rtsx_usb_ms driver module if not required for system operation
Patch Information
The vulnerability has been addressed in the upstream Linux kernel through commit 42933c8aa14be1caa9eda41f65cde8a3a95d3e39. This fix properly handles memory management during driver removal to prevent the use-after-free condition.
Patches are available from multiple sources:
- Linux Kernel Commit Update - Upstream kernel fix
- Red Hat Bug Report #2044561 - Red Hat tracking and patches
- Debian Security Advisory DSA-5095 - Debian security update
- Debian Security Advisory DSA-5096 - Additional Debian security update
Workarounds
- Disable or blacklist the rtsx_usb_ms kernel module using modprobe -r rtsx_usb_ms or adding it to the module blacklist
- Restrict physical access to USB ports on sensitive systems to prevent device-based exploitation
- Limit local user access on affected systems until patches can be applied
# Blacklist the vulnerable driver module
echo "blacklist rtsx_usb_ms" >> /etc/modprobe.d/blacklist-rtsx.conf
# Remove the module if currently loaded
modprobe -r rtsx_usb_ms
# Verify the module is not loaded
lsmod | grep rtsx_usb_ms
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


