On Fri, 25 Jun 2004, Duncan Sands wrote:

> By the way Alan, maybe there should be a check that the maxpacket size
> is valid.  I have a device that sometimes returns a maxpacket size of zero
> (in fact the whole 8 bytes read is zero - maybe nothing was read but the
> error reporting logic is wrong somewhere?).  Given the number of bad
> USB devices out there, maybe it is wise to add a sanity check here, and
> fail (-EIO?) if a rubbish value is seen.  What do you think?

It wouldn't be hard to do.  How much would it end up helping?  It seems to 
me that ep0 maxpacket is a pretty hard thing to mess up -- surely a bad 
value would cause problems the very first time anyone tried to use the 
device.

Like in your case.  Setting the maxpacket size to 0 will effectively 
disable endpoint 0 -- no URBs will be accepted.  So the attempt to read 
the full device descriptor would fail and the device would be rejected.  
Would adding the additional test improve this behavior at all?

Alan Stern



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to