On Thu, Jan 02, 2020 at 10:06:33AM -0500, Alan Stern wrote: > On Thu, 2 Jan 2020, Takashi Iwai wrote: > > On Thu, 02 Jan 2020 12:20:45 +0100, Johan Hovold wrote: > > > Note that we also have this little gem in the ftdi usb-serial driver > > > (since 2009) overriding a zero max packet size for devices with broken > > > descriptors: > > > > > > 895f28badce9 ("USB: ftdi_sio: fix hi-speed device packet size calculation") > > > > > > Note sure how common those are but they will no longer work after the > > > new sanity check in core. I guess we could add quirks for them (to core) > > > in case we get any reports, but perhaps reverting the check should be > > > considered. > > > > FWIW, Roger confirmed that reverting the commit d482c7bb0541 does > > indeed fix the issue (with the latest 5.4.y kernel). > > All right. Suppose instead of reverting that commit, I change the code > so that it only logs a warning when it finds an endpoint descriptor > with maxpacket = 0 (and it skips the warning for isochronous endpoints > in altsetting 0). At the same time, we can add a check to > usb_submit_urb() to refuse URBs if the endpoint's maxpacket is 0. > > Sounds good? Sounds good to me. Just make sure not to add a WARN() in usb_submit_urb() so that we end up having to add maxpacket checks to every USB driver when syzbot starts hitting this (only driver's doing maxpacket divisions or similar should need that). Johan