CVE-2026-143396: net/9p/usbg: fix descriptor cleanup use-after-free
In the Linux kernel, the following vulnerability has been resolved:
net/9p/usbg: fix descriptor cleanup use-after-free
usb9pfsfreefunc() frees the fusb9pfs object before calling usbfreealldescriptors(). The usbfunction passed to the latter is embedded in the freed object, so removing the function from a gadget dereferences freed memory.
The failing teardown sequence is:
configfs unlink usb9pfsfreefunc() kfree(usb9pfs) usbfreealldescriptors(f) dereference the embedded usbfunction
KASAN reported:
BUG: KASAN: slab-use-after-free in usbfreealldescriptors+0x138/0x190 Read of size 8 at addr ffff888106a73088 by task poc/95 Call Trace: usbfreealldescriptors+0x138/0x190 configusbcfgunlink+0x1f0/0x2f0 configfsunlink+0x321/0x6f0
Free the descriptors before freeing their containing object.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In usb9pfs_free_func(), call usb_free_all_descriptors(f) before freeing the containing usb9pfs object with kfree(usb9pfs).
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Linux kernel systems that use the usb9pfs USB gadget function and remove that function through configfs are affected by the vulnerable teardown path.
What can be done if the fix cannot be deployed immediately?
Avoid unlinking or removing configured usb9pfs functions through configfs until the kernel includes the descriptor-cleanup ordering fix.
How can I identify whether this failure has occurred?
KASAN may report a slab use-after-free in usb_free_all_descriptors during config_usb_cfg_unlink or configfs_unlink. The report can show a read from the embedded usb_function after the containing f_usb9pfs object was freed.