CVE-2026-31725
Description
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: f_ecm: Fix net_device lifecycle with device_move
The net_device is allocated during function instance creation and registered during the bind phase with the gadget device as its sysfs parent. When the function unbinds, the parent device is destroyed, but the net_device survives, resulting in dangling sysfs symlinks:
console:/ # ls -l /sys/class/net/usb0 lrwxrwxrwx ... /sys/class/net/usb0 -> /sys/devices/platform/.../gadget.0/net/usb0 console:/ # ls -l /sys/devices/platform/.../gadget.0/net/usb0 ls: .../gadget.0/net/usb0: No such file or directory
Use device_move() to reparent the net_device between the gadget device tree and /sys/devices/virtual across bind and unbind cycles. During the final unbind, calling device_move(NULL) moves the net_device to the virtual device tree before the gadget device is destroyed. On rebinding, device_move() reparents the device back under the new gadget, ensuring proper sysfs topology and power management ordering.
To maintain compatibility with legacy composite drivers (e.g., multi.c), the bound flag is used to indicate whether the network device is shared and pre-registered during the legacy driver's bind phase.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Linux kernel USB gadget f_ecm driver: net_device lifecycle mismatch after unbind causes dangling sysfs symlinks, resolved by reparenting via device_move().
Root
Cause
The vulnerability in the Linux kernel's USB gadget f_ecm function driver arises from a lifecycle management flaw. The net_device is allocated during function instance creation and registered with the gadget device as its sysfs parent during the bind phase. However, when the function unbinds, the parent gadget device is destroyed while the net_device persists, leaving dangling sysfs symlinks (e.g., /sys/class/net/usb0 pointing to a nonexistent path) [1]. This breaks sysfs topology and can cause errors in userspace tools and power management ordering.
Exploitation
Scenario
While this is not a remotely exploitable vulnerability, it can be triggered by any user or process capable of causing a USB gadget function to unbind and rebind. Typical scenarios include reconfiguring a USB gadget device or dynamic loading/unloading of composite drivers. The dangling symlinks do not grant direct privilege escalation, but they can lead to system instability, confuse network management utilities, and potentially enable information leak through stale device references.
Impact
An attacker with the ability to manipulate USB gadget bindings (e.g., via physical access or certain administrative actions) could repeatedly exploit this condition. The primary impact is a denial of service (system availability) due to failed operations on the orphaned net_device and unpredictable behavior of the networking stack. The CVSS v3 score of 5.5 (Medium) reflects the moderate severity of this availability issue.
Mitigation
The fix has been applied in multiple Linux kernel stable commits. The main commit [1] and its backports [2][3][4] introduce the use of device_move() to reparent the net_device to /sys/devices/virtual before the gadget device is destroyed during unbind, and to move it back under the new gadget on rebind. Users should apply the latest kernel updates from their distribution. No workaround is available for unpatched kernels.
AI Insight generated on May 18, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
7cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*+ 6 more
- cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*range: >=3.11,<6.12.81
- cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:*
- cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:*
- cpe:2.3:o:linux:linux_kernel:7.0:rc3:*:*:*:*:*:*
- cpe:2.3:o:linux:linux_kernel:7.0:rc4:*:*:*:*:*:*
- cpe:2.3:o:linux:linux_kernel:7.0:rc5:*:*:*:*:*:*
- cpe:2.3:o:linux:linux_kernel:7.0:rc6:*:*:*:*:*:*
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4News mentions
1- Patch Tuesday - May 2026Rapid7 Blog · May 13, 2026