CVE-2026-98763: usb: core: clear both ep_in and ep_out for non-ep0 control endpoints
In the Linux kernel, the following vulnerability has been resolved:
usb: core: clear both epin and epout for non-ep0 control endpoints
In usbenableendpoint(), non-zero control endpoints (where usbendpointxfercontrol(&ep->desc) is true) populate both dev->epin[epnum] and dev->epout[epnum] with the same struct usbhostendpoint pointer.
However, usbdisableendpoint() only clears either dev->epout[epnum] or dev->epin[epnum] depending on the direction bit of epaddr when resethardware is set, leaving the opposite direction's array slot pointing to the disabled/freed endpoint.
Clear both dev->epout[epnum] and dev->epin[epnum] when disabling a non-ep0 control endpoint with resethardware set, and update the function kerneldoc accordingly.
Tested in QEMU against Linux 7.3.0-rc3 using dummyhcd and raw-gadget to enumerate a USB device with a non-zero control endpoint (bEndpointAddress 0x01, bmAttributes USBENDPOINTXFERCONTROL), verifying that both dev->epin[1] and dev->epout[1] are cleared when the interface is disabled.