5.5medium
usb: gadget: f_rndis: Fix net_device lifecycle with device_move
- Severity
- 5.5medium CVSS:3.1 by NVD
- Exploit likelihood
- 0.16% (higher than 5% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_rndis: 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 borrowed_net flag is used to indicate whether the network device is shared and pre-registered during the legacy driver's bind phase.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from f466c6353819326873fa48a02c6f2d7c903240d6 before f374388891778c2f58facc0f61f2610a206a1876, from f466c6353819326873fa48a02c6f2d7c903240d6 before 9701a98f4459b52558f683b6b12a6feb6f17b255, from f466c6353819326873fa48a02c6f2d7c903240d6 before 1ef251aa63972fe6c0f107f5abd139b7d0f7987a, from f466c6353819326873fa48a02c6f2d7c903240d6 before 18ada801899f2b13ef0ceff42427ad980a41e619, from f466c6353819326873fa48a02c6f2d7c903240d6 before 6045ea5ca6e3fa13f8a9fafb1c535c86e124c14d, from f466c6353819326873fa48a02c6f2d7c903240d6 before e367599529dc42578545a7f85fde517b35b3cda7, 3.11 Not affected: before 3.11, from 6.1.191 up to 6.1.*, from 6.6.160 up to 6.6.*, from 6.12.81 up to 6.12.*, from 6.18.22 up to 6.18.*, from 6.19.12 up to 6.19.* | CVE List |
| linux linux_kernel | from 3.11 before 6.12.81, from 6.13 before 6.18.22, from 6.19 before 6.19.12, 7.0 | NVD |
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_rndis: 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 borrowed_net flag is used to indicate whether the network device is shared and pre-registered during the legacy driver's bind phase.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: usb: gadget: f_rndis: Corrección del ciclo de vida de net_device con device_move El net_device se asigna durante la creación de la instancia de función y se registra durante la fase de enlace con el dispositivo gadget como su padre sysfs. Cuando la función se desenlaza, el dispositivo padre es destruido, pero el net_device sobrevive, lo que resulta en enlaces simbólicos sysfs colgantes: 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 Usar device_move() para reparentar el net_device entre el árbol de dispositivos gadget y /sys/devices/virtual a través de los ciclos de enlace y desenlace. Durante el desenlace final, llamar a device_move(NULL) mueve el net_device al árbol de dispositivos virtuales antes de que el dispositivo gadget sea destruido. Al reenlazar, device_move() reparenta el dispositivo de nuevo bajo el nuevo gadget, asegurando una topología sysfs adecuada y un ordenamiento de la gestión de energía. Para mantener la compatibilidad con los controladores compuestos heredados (p. ej., multi.c), se utiliza la bandera borrowed_net para indicar si el dispositivo de red es compartido y pre-registrado durante la fase de enlace del controlador heredado.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-31722 changed 2026-10-30 | CVE Terms of Use |
| NVD | CVE-2026-31722 changed 2026-11-11 | Public domain |