HIGH
mmc vub300 Controller UAF
CVE-2026-31650
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: mmc: vub300: fix use-after-free on disconnect The vub300 driver maintains an explicit reference count for the controller and its driver data and the last reference can in theory be dropped after the driver has been unbound. This specifically means that the controller allocation must not be device managed as that can lead to use-after-free. Note that the lifetime is currently also incorrectly tied the parent USB device rather than interface, which can lead to memory leaks if the driver is unbound without its device being physically disconnected (e.g. on probe deferral). Fix both issues by reverting to non-managed allocation of the controller.
02KernelScan AI Analysis
Risk summary
A use-after-free vulnerability in the vub300 MMC USB driver that can be triggered during device disconnect. An attacker with physical access to connect/disconnect USB devices could potentially cause memory corruption, leading to system crashes or possible privilege escalation. The vulnerability affects systems using vub300 USB-to-MMC adapters.
Vulnerability analysis
Summary: Use-after-free vulnerability in vub300 MMC driver due to incorrect device-managed memory allocation
Root Cause: The vub300 driver was converted to use devm_mmc_alloc_host() for device-managed allocation, but this conflicts with the driver's explicit reference counting mechanism. The driver maintains a kref for the controller that can be dropped after driver unbind, but device-managed memory is freed when the USB device is removed, creating a timing mismatch that leads to use-after-free conditions.
Attack Surface: Local attack surface requiring physical USB device access. The vulnerability is triggered during USB device disconnect scenarios, particularly when the driver is unbound while references still exist. Requires ability to connect/disconnect USB devices or trigger driver unbind operations.
Fix Mechanism: The patch reverts to manual memory management by replacing devm_mmc_alloc_host() with mmc_alloc_host() and adding explicit mmc_free_host() calls in the cleanup path (vub300_delete function) and error handling. This ensures the MMC host structure lifetime is properly tied to the driver's reference counting rather than device lifecycle.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 6.18 | 6.18.23 | ea7468f61be0 |
| 6.19 | 6.19.13 | ef0448c569b3 |
| mainline | 7.0 | 8f4d20a71022 |