{"id":"CVE-2026-31722","state":"PUBLISHED","title":"usb: gadget: f_rndis: Fix net_device lifecycle with device_move","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: f_rndis: Fix net_device lifecycle with device_move\n\nThe net_device is allocated during function instance creation and\nregistered during the bind phase with the gadget device as its sysfs\nparent. When the function unbinds, the parent device is destroyed, but\nthe net_device survives, resulting in dangling sysfs symlinks:\n\n  console:/ # ls -l /sys/class/net/usb0\n  lrwxrwxrwx ... /sys/class/net/usb0 ->\n  /sys/devices/platform/.../gadget.0/net/usb0\n  console:/ # ls -l /sys/devices/platform/.../gadget.0/net/usb0\n  ls: .../gadget.0/net/usb0: No such file or directory\n\nUse device_move() to reparent the net_device between the gadget device\ntree and /sys/devices/virtual across bind and unbind cycles. During the\nfinal unbind, calling device_move(NULL) moves the net_device to the\nvirtual device tree before the gadget device is destroyed. On rebinding,\ndevice_move() reparents the device back under the new gadget, ensuring\nproper sysfs topology and power management ordering.\n\nTo maintain compatibility with legacy composite drivers (e.g., multi.c),\nthe borrowed_net flag is used to indicate whether the network device is\nshared and pre-registered during the legacy driver's bind phase.","publishedAt":"2026-05-01T14:14:24.156Z","updatedAt":"2026-10-30T12:24:36.328Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f466c6353819326873fa48a02c6f2d7c903240d6","status":"affected","lessThan":"f374388891778c2f58facc0f61f2610a206a1876","versionType":"git"},{"version":"f466c6353819326873fa48a02c6f2d7c903240d6","status":"affected","lessThan":"9701a98f4459b52558f683b6b12a6feb6f17b255","versionType":"git"},{"version":"f466c6353819326873fa48a02c6f2d7c903240d6","status":"affected","lessThan":"1ef251aa63972fe6c0f107f5abd139b7d0f7987a","versionType":"git"},{"version":"f466c6353819326873fa48a02c6f2d7c903240d6","status":"affected","lessThan":"18ada801899f2b13ef0ceff42427ad980a41e619","versionType":"git"},{"version":"f466c6353819326873fa48a02c6f2d7c903240d6","status":"affected","lessThan":"6045ea5ca6e3fa13f8a9fafb1c535c86e124c14d","versionType":"git"},{"version":"f466c6353819326873fa48a02c6f2d7c903240d6","status":"affected","lessThan":"e367599529dc42578545a7f85fde517b35b3cda7","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/usb/gadget/function/f_rndis.c","drivers/usb/gadget/function/u_rndis.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.11","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.11","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.81","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.22","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19.12","status":"unaffected","lessThanOrEqual":"6.19.*","versionType":"semver"},{"version":"7.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/usb/gadget/function/f_rndis.c","drivers/usb/gadget/function/u_rndis.h"]}],"references":["https://git.kernel.org/stable/c/f374388891778c2f58facc0f61f2610a206a1876","https://git.kernel.org/stable/c/9701a98f4459b52558f683b6b12a6feb6f17b255","https://git.kernel.org/stable/c/1ef251aa63972fe6c0f107f5abd139b7d0f7987a","https://git.kernel.org/stable/c/18ada801899f2b13ef0ceff42427ad980a41e619","https://git.kernel.org/stable/c/6045ea5ca6e3fa13f8a9fafb1c535c86e124c14d","https://git.kernel.org/stable/c/e367599529dc42578545a7f85fde517b35b3cda7"],"weaknesses":[],"ingestedAt":"2026-10-30T12:42:04.495Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/31xxx/CVE-2026-31722.json","commit":"db8103c5921aac81d5d90efcf3745980dafabf49","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-31722","state":"PUBLISHED","datePublished":"2026-05-01T14:14:24.156Z","dateUpdated":"2026-10-30T12:24:36.328Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-03-09T15:48:24.134Z"},"containers":{"cna":{"title":"usb: gadget: f_rndis: Fix net_device lifecycle with device_move","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: f_rndis: Fix net_device lifecycle with device_move\n\nThe net_device is allocated during function instance creation and\nregistered during the bind phase with the gadget device as its sysfs\nparent. When the function unbinds, the parent device is destroyed, but\nthe net_device survives, resulting in dangling sysfs symlinks:\n\n  console:/ # ls -l /sys/class/net/usb0\n  lrwxrwxrwx ... /sys/class/net/usb0 ->\n  /sys/devices/platform/.../gadget.0/net/usb0\n  console:/ # ls -l /sys/devices/platform/.../gadget.0/net/usb0\n  ls: .../gadget.0/net/usb0: No such file or directory\n\nUse device_move() to reparent the net_device between the gadget device\ntree and /sys/devices/virtual across bind and unbind cycles. During the\nfinal unbind, calling device_move(NULL) moves the net_device to the\nvirtual device tree before the gadget device is destroyed. On rebinding,\ndevice_move() reparents the device back under the new gadget, ensuring\nproper sysfs topology and power management ordering.\n\nTo maintain compatibility with legacy composite drivers (e.g., multi.c),\nthe borrowed_net flag is used to indicate whether the network device is\nshared and pre-registered during the legacy driver's bind phase."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f466c6353819326873fa48a02c6f2d7c903240d6","status":"affected","lessThan":"f374388891778c2f58facc0f61f2610a206a1876","versionType":"git"},{"version":"f466c6353819326873fa48a02c6f2d7c903240d6","status":"affected","lessThan":"9701a98f4459b52558f683b6b12a6feb6f17b255","versionType":"git"},{"version":"f466c6353819326873fa48a02c6f2d7c903240d6","status":"affected","lessThan":"1ef251aa63972fe6c0f107f5abd139b7d0f7987a","versionType":"git"},{"version":"f466c6353819326873fa48a02c6f2d7c903240d6","status":"affected","lessThan":"18ada801899f2b13ef0ceff42427ad980a41e619","versionType":"git"},{"version":"f466c6353819326873fa48a02c6f2d7c903240d6","status":"affected","lessThan":"6045ea5ca6e3fa13f8a9fafb1c535c86e124c14d","versionType":"git"},{"version":"f466c6353819326873fa48a02c6f2d7c903240d6","status":"affected","lessThan":"e367599529dc42578545a7f85fde517b35b3cda7","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/usb/gadget/function/f_rndis.c","drivers/usb/gadget/function/u_rndis.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.11","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.11","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.81","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.22","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19.12","status":"unaffected","lessThanOrEqual":"6.19.*","versionType":"semver"},{"version":"7.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/usb/gadget/function/f_rndis.c","drivers/usb/gadget/function/u_rndis.h"]}],"references":[{"url":"https://git.kernel.org/stable/c/f374388891778c2f58facc0f61f2610a206a1876"},{"url":"https://git.kernel.org/stable/c/9701a98f4459b52558f683b6b12a6feb6f17b255"},{"url":"https://git.kernel.org/stable/c/1ef251aa63972fe6c0f107f5abd139b7d0f7987a"},{"url":"https://git.kernel.org/stable/c/18ada801899f2b13ef0ceff42427ad980a41e619"},{"url":"https://git.kernel.org/stable/c/6045ea5ca6e3fa13f8a9fafb1c535c86e124c14d"},{"url":"https://git.kernel.org/stable/c/e367599529dc42578545a7f85fde517b35b3cda7"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-30T12:24:36.328Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.11","versionEndExcluding":"6.1.191"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.11","versionEndExcluding":"6.6.160"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.11","versionEndExcluding":"6.12.81"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.11","versionEndExcluding":"6.18.22"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.11","versionEndExcluding":"6.19.12"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.11","versionEndExcluding":"7.0"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}