Thomas Sailer wrote:
>
> David Brownell wrote:
> >
> > > >2. Why open with O_RDWR? Is that a requirement of usbdevfs?
> >
> > Basically, yes -- even when performing "read" control messages.
> > Not a requirement I much like seeing imposed.
neither do I.
> IMNSHO one wants to give normal users the ability to see what
> devices are connected (they can read the stored descriptors), but
> one does not want an arbitrary user to crash an arbitrary USB device.
>
> Many USB devices can be crashed by sending an inappropriate control
> request even if it is only a read request. That's why write perms
> are required even for read requests.
Which is a usb spec violation ?
I see what you mean though. We actually have two flags for three levels of
access.
o read stored descriptors
o full read (real reads to the device)
o full read/write
If this is correct, I believe the correct choice is made. Crashing devices
should be prevented... even if they are out of spec.
Which descriptors are stored ? all of them ?
> And btw. a read request
> also requires a write phase on the USB bus.
But not a write phase to the device!
By reading descriptors you cannot change the configuration of the device, so
it can be given to every user. (depending on the r flags off course).
Arguing it is a write phase on the USB bus is like arguing a read from disk is
also a write phase to memory! (or on the PCI bus, or memory bus, whatever...)
J.
--
________
/---------------------------------\ /--------------------\
| Johan Verrept \ / Alcatel |
| Software Development Engineer \ / De Villermontstr 38|
| xDSL Customer Premises Equipment \/ B-2550 Kontich |
| http://www.alcateldsl.com/ ALC/\TEL Belgium |
| mailto:[EMAIL PROTECTED] Phone: +32 3 450 3506 |
\-------------------------------------------------------------/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]