CVE-2024-42236

5.5 MEDIUM

📋 TL;DR

This CVE describes an out-of-bounds (OOB) read/write vulnerability in the Linux kernel's USB gadget configfs subsystem. Attackers can trigger memory corruption by providing zero-length strings to the usb_string_copy() function, potentially leading to kernel crashes or privilege escalation. Systems using USB gadget functionality in affected Linux kernel versions are vulnerable.

💻 Affected Systems

Products:
  • Linux kernel
Versions: Specific affected versions not explicitly stated in CVE description; check kernel commit history for exact ranges.
Operating Systems: Linux distributions using vulnerable kernel versions
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems with USB gadget functionality enabled (CONFIG_USB_CONFIGFS). Many embedded/IoT devices and some servers use this feature.

📦 What is this software?

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

⚠️ Risk & Real-World Impact

🔴

Worst Case

Kernel panic leading to system crash, or local privilege escalation to root if memory corruption can be controlled to execute arbitrary code.

🟠

Likely Case

Kernel crash/panic causing denial of service, requiring system reboot.

🟢

If Mitigated

Minimal impact if proper input validation is implemented or vulnerable functionality is disabled.

🌐 Internet-Facing: LOW - This requires local access to the system's USB gadget interface.
🏢 Internal Only: MEDIUM - Local attackers or malicious users could exploit this to crash systems or potentially escalate privileges.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Requires local access to trigger the vulnerable function. Exploitation depends on controlling memory layout and corruption effects.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Kernel versions containing commits: 2d16f63d8030903e5031853e79d731ee5d474e70, 6d3c721e686ea6c59e18289b400cc95c76e927e0, 72b8ee0d9826e8ed00e0bdfce3e46b98419b37ce, a444c3fc264119801575ab086e03fb4952f23fd0, c95fbdde87e39e5e0ae27f28bf6711edfb985caa

Vendor Advisory: https://git.kernel.org/stable/c/2d16f63d8030903e5031853e79d731ee5d474e70

Restart Required: Yes

Instructions:

1. Update Linux kernel to patched version from your distribution's repositories. 2. Reboot system to load new kernel. 3. Verify kernel version after reboot.

🔧 Temporary Workarounds

Disable USB gadget configfs

linux

Disable the vulnerable USB configfs functionality if not required.

modprobe -r usb_f_configfs
modprobe -r usb_f_acm
modprobe -r usb_f_mass_storage
echo 'blacklist usb_f_configfs' >> /etc/modprobe.d/blacklist.conf

🧯 If You Can't Patch

  • Restrict local user access to systems with USB gadget functionality
  • Implement strict access controls and monitoring for USB gadget interfaces

🔍 How to Verify

Check if Vulnerable:

Check kernel version and if USB configfs modules are loaded: 'lsmod | grep usb_f_configfs' and 'uname -r'

Check Version:

uname -r

Verify Fix Applied:

Verify kernel version is updated to include the fix commits, and test USB gadget functionality if required.

📡 Detection & Monitoring

Log Indicators:

  • Kernel panic logs
  • OOPs messages in /var/log/kern.log or dmesg
  • USB gadget related crash reports

Network Indicators:

  • None - this is a local vulnerability

SIEM Query:

Search for kernel panic events or USB subsystem crashes in system logs

🔗 References

📤 Share & Export