usb: gadget: f_subset: Fix net_device lifecycle with device_move
Published May 1, 2026
5.5
MEDIUMCVSS 3.1
EPSS 0.16%
Description
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.
Affected products
-
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version
-
- Version 3.11StatusaffectedConstraints-
- Version 0StatusunaffectedConstraints<3.11
- Version 6.12.81StatusunaffectedConstraints<=6.12.*
- Version 6.18.22StatusunaffectedConstraints<=6.18.*
- Version 6.19.12StatusunaffectedConstraints<=6.19.*
- Version 7.0StatusunaffectedConstraints<=*
- Version
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
- ≥ 3.11 · < 6.12.81
- ≥ 6.13 · < 6.18.22
- ≥ 6.19 · < 6.19.12
- 7.0
- 7.0
- 7.0
- 7.0
- 7.0
- 7.0
No data.
Red Hat Enterprise Linux 10
kernel
Not affected
Red Hat Enterprise Linux 6
kernel
Not affected
Red Hat Enterprise Linux 7
kernel
Not affected
Red Hat Enterprise Linux 7
kernel-rt
Not affected
Red Hat Enterprise Linux 8
kernel
Not affected
Red Hat Enterprise Linux 8
kernel-rt
Not affected
Red Hat Enterprise Linux 9
kernel
Not affected
Red Hat Enterprise Linux 9
kernel-rt
Not affected
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 10 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 6 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 7 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 7 | kernel-rt | Not affected | n/a |
| Red Hat Enterprise Linux 8 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 8 | kernel-rt | Not affected | n/a |
| Red Hat Enterprise Linux 9 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 9 | kernel-rt | Not affected | n/a |
No package ranges for this CVE.
Remediation
No remediation recorded yet.
References (10)
- https://access.redhat.com/security/cve/CVE-2026-31723 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=2464425 Issue Tracking
- https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-26536 Advisory
- https://git.kernel.org/stable/c/06524cd1c9011bee141a87e43ab878641ed3652b Patch
- https://git.kernel.org/stable/c/70707ce668494c4d35fe070dfbc7cc541b293107 Patch
- https://git.kernel.org/stable/c/9cbc4f109bb216623894d8819fb930210ed34b21 Patch
- https://git.kernel.org/stable/c/fde29916e4cc736c4ca6c78f331e12b2c73ccafd Patch
- https://lore.kernel.org/linux-cve-announce/2026050134-CVE-2026-31723-a0a7@gregkh/T
- https://nvd.nist.gov/vuln/detail/CVE-2026-31723
- https://www.cve.org/CVERecord?id=CVE-2026-31723
Change history (0)
No recorded changes yet.