CVE-2026-139718 — Linux Kernel — NONE Vulnerability
In the Linux kernel, the following vulnerability has been resolved: usb: image: microtek: stop SG processing after transfer errors When an SG URB completes with an error, mts_do_sg() calls mts_transfer_cleanup(), which completes the SCSI command through scsi_done(). However, the callback continues advancing the scatterlist and may submit another URB for a command that has already been completed. Return immediately after the cleanup so that no further processing is performed on the completed command.
In the Linux kernel, the following vulnerability has been resolved: usb: image: microtek: stop SG processing after transfer errors When an SG URB completes with an error, mts_do_sg() calls mts_transfer_cleanup(), which completes the SCSI command through scsi_done(). However, the callback continues advancing the scatterlist and may submit another URB for a command that has already been completed. Return immediately after the cleanup so that no further processing is performed on the completed command.
🎯 What is this vulnerability?
This vulnerability is a Use-After-Free (UAF) or, more precisely, a Logic Error leading to Double Completion/Invalid Memory Access within the Linux kernel's USB Mass Storage driver, specifically the usb-storage module's Microtek (microtek.c) handler.
Technical Flaw Analysis:
1. Context: The microtek driver handles USB storage devices that use Scatter-Gather (SG) lists for data transfers.
2. The Bug: When a Scatter-Gather URB (USB Request Block) completes with an error status, the function mts_do_sg() invokes mts_transfer_cleanup().
3. The Failure: mts_transfer_cleanup() calls scsi_done(), which signals to the SCSI mid-layer that the command is finished. However, the execution flow in mts_do_sg() does not stop. It continues to iterate through the scatterlist and attempts to submit a new URB for the same command.
4. Consequence: Since the SCSI command has already been completed (and potentially the associated scsi_cmnd structure or its associated memory resources have been released or marked as done by the mid-layer), submitting a new URB for it leads to:
* Kernel Panic: If the memory backing the command structure is freed, accessing it to build the next URB results in a UAF.
* Data Corruption: If the memory is not immediately freed but the state is inconsistent, it may lead to garbage data being written or read.
* Denial of Service: The system may hang or crash due to the invalid state transition.
CWE Classification:
- CWE-416: Use After Free (Primary)
- CWE-664: Improper Control of a Resource Through its Lifetime (Secondary)
- It requires a specific, faulty USB device (Microtek class) to be connected.
- It requires the device to trigger a specific error condition during an SG transfer.
- It is a local physical access vulnerability (plug-in a malicious USB stick).
- It does not allow arbitrary code execution (RCE) in a remote context, only a local DoS (kernel panic).
- Target Identification: The attacker identifies a target Linux system (likely an embedded device, IoT gateway, or server with USB ports enabled) running a kernel version between 2.6.12 and the commit 97608e12256d959885432518a1e9581667a49cb6.
- Physical Access: The attacker requires physical access to the target machine to plug in a USB device.
- Firmware/Kernel Check: The attacker verifies the kernel version via
uname -r(if they have prior shell access) or by observing the device's boot logs/behavior. Themicrotekdriver must be loaded (lsmod | grep microtekorusb-storagemodule active). - Malicious USB Device: The attacker crafts a USB Mass Storage device (using a microcontroller like an Arduino or Raspberry Pi Pico) that emulates a Microtek USB storage device.
- Triggering the Error: The device firmware is programmed to: 1. Accept a SCSI command (e.g.,
- Kernel Crash: When the kernel's
microtekdriver processes this error, it callsscsi_done()but continues to process the scatterlist, leading to a kernel panic.
CVSS Note: The provided CVSS score is 0/10 (NONE). This is highly unusual for a kernel bug that can cause a panic. It is likely that the CVSS vector was not properly populated in the source data, or the vulnerability is considered Low Severity because:
Correction for Analysis: For a kernel UAF/Logic error leading to panic, a realistic CVSS would be Medium (5.5 - 6.5) with vector CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H. The "0" score in the prompt is treated as a data artifact, but the technical analysis remains valid for a local DoS.
⚡ Attack Chain
1. Discovery & Reconnaissance
2. Exploitation
READ(10) or WRITE(10)).
2. Initiate a Scatter-Gather transfer.
3. Deliberately fail the URB transfer (e.g., by disconnecting the data phase, sending a NAK, or returning an error status in the URB completion callback).
Illustrative PoC Concept (C Firmware for USB Device):
// Pseudo-code for malicious USB device firmware
void on_scsi_command(scsi_cmd_t *cmd) {
if (cmd->opcode == READ_10 || cmd->opcode == WRITE_10) {
// Start SG transfer
start_sg_transfer(cmd);
// In the URB completion handler:
// 1. Return an error status (e.g., URB_ERROR)
// 2. Do NOT complete the SCSI command properly from the device side
// (Let the kernel think it's an error, triggering the bug path)
}
}
// Kernel side (vulnerable code flow):
// mts_do_sg() -> URB completes with error
// -> mts_transfer_cleanup() -> scsi_done() [Command marked done]
// -> Loop continues -> mts_do_sg() submits next URB for same cmd [BUG]3. Post-Exploitation
🌍 Real World Impact
Practical Consequences:
🛡️ Remediation & Mitigation
1. Patching
mts_do_sg() after mts_transfer_cleanup() is called on error.// Vulnerable code (simplified)
if (urb->status) {
mts_transfer_cleanup(mts);
// BUG: Continues to next iteration
}
// Fixed code
if (urb->status) {
mts_transfer_cleanup(mts);
return; // FIX: Stop processing
}2. Workarounds
usb-storage module or blacklist the microtek driver.# Blacklist the microtek driver
echo "blacklist microtek" > /etc/modprobe.d/blacklist-microtek.conf
update-initramfs -uusbguard to restrict which USB devices can be connected.# Example usbguard rule to block unknown USB storage devices
allow id 0451:1688 name "Microtek USB Storage" serial "MALICIOUS" with:
interface 0 class 8 subclass 6 protocol 0
# Block all other USB storage devices
block id *:* name "*"3. Detection
microtek or usb-storage.dmesg | grep -i "microtek\|usb-storage\|BUG\|Oops"syslog or journalctl for unexpected USB device connections.journalctl -k | grep "usb"0451:1688) that are not authorized.⚠️ Urgency
Conclusion: This is a local denial-of-service vulnerability. It is not remotely exploitable and does not lead to code execution. Patching is recommended as part of regular kernel updates, but it is not an emergency unless the system is physically accessible to untrusted individuals.
[🤖 CVE Professor AI Security Engine]
FOFA Query