Re: [PATCH 1/3] USB: core: drop pipe-type check from new control-message helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 04, 2020 at 09:51:08AM +0100, Johan Hovold wrote:
> The new control-message helpers include a pipe-type check which is
> almost completely redundant.
> 
> Control messages are generally sent to the default pipe which always
> exists and is of the correct type since its endpoint representation is
> created by USB core as part of enumeration for all devices.
> 
> There is currently only one instance of a driver in the tree which use
> a control endpoint other than endpoint 0 (and it does not use the new
> helpers).
> 
> Drivers should be testing for the existence of their resources at probe
> rather than at runtime, but to catch drivers failing to do so USB core
> already does a sanity check on URB submission and triggers a WARN().
> Having the same sanity check done in the helper only suppresses the
> warning without allowing us to find and fix the drivers.

The issue is "bad" devices.  syzbot fuzzed the USB sound drivers with
stuff like this and found a bunch of problems, which is where this check
originally came from.  While it is nice to "warn" people, that keeps
moving forward and then the driver tries to submit an urb for this
endpoint and things blow up.  Or throw more warnings, I can't remember.

So I'd like to keep this check here if at all possible, to ensure we
don't have to fix those "bugs" again, it's not hurting anything here, is
it?

thanks,

greg k-h



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux