Acknowledged
Created: Oct 10, 2025
Updated: Oct 17, 2025
Found In Version: 10.23.30.1
Severity: Standard
Applicable for: Wind River Linux LTS 23
Component/s: Kernel
In the Linux kernel, the following vulnerability has been resolved:[EOL][EOL]USB: Gadget: core: Help prevent panic during UVC unconfigure[EOL][EOL]Avichal Rakesh reported a kernel panic that occurred when the UVC[EOL]gadget driver was removed from a gadget's configuration. The panic[EOL]involves a somewhat complicated interaction between the kernel driver[EOL]and a userspace component (as described in the Link tag below), but[EOL]the analysis did make one thing clear: The Gadget core should[EOL]accomodate gadget drivers calling usb_gadget_deactivate() as part of[EOL]their unbind procedure.[EOL][EOL]Currently this doesn't work. gadget_unbind_driver() calls[EOL]driver->unbind() while holding the udc->connect_lock mutex, and[EOL]usb_gadget_deactivate() attempts to acquire that mutex, which will[EOL]result in a deadlock.[EOL][EOL]The simple fix is for gadget_unbind_driver() to release the mutex when[EOL]invoking the ->unbind() callback. There is no particular reason for[EOL]it to be holding the mutex at that time, and the mutex isn't held[EOL]while the ->bind() callback is invoked. So we'll drop the mutex[EOL]before performing the unbind callback and reacquire it afterward.[EOL][EOL]We'll also add a couple of comments to usb_gadget_activate() and[EOL]usb_gadget_deactivate(). Because they run in process context they[EOL]must not be called from a gadget driver's ->disconnect() callback,[EOL]which (according to the kerneldoc for struct usb_gadget_driver in[EOL]include/linux/usb/gadget.h) may run in interrupt context. This may[EOL]help prevent similar bugs from arising in the future.