On Friday 27 January 2006 3:38 pm, Micah Dowty wrote: > If usbfs really does need to verify that packets > are correct as per the spec, it should be checking this against > the endpoint's maximum packet size.
Actually those checks should live in the main urb submit paths, leaving HCDs to test only for limits that are _lower_ than the ones allowed in the spec. (For example, some silicon might be configured with zero, or limited, support for transferring more than one KByte per microframe.) So OHCI would fail cleanly there. > If usbfs' job is just to > sanity check the sizes to prevent memory allocation issues, > this number could be much larger and much more arbitrary. Makes sense, but I think it's normally better to strip out illegal values as early as practical. It's one of those programming-101 sorts of policies that will be argued against later in programming-330. Best of course would be never copying the I/O buffers at all, just using get_user_pages() to morph the userspace buffer into a kernel scatterlist. (For non-control paths.) But nobody seems to want take the next "endpoint per filedescriptor" steps any time soon. > I would argue that usbfs shouldn't be strictly verifying URBs > against the spec- it should just provide enough protection to > keep a userspace process from making the machine or the host > controller unstable. How much is that though? Sounds like a very platform-specific answer! - Dave ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel