[usb-storage] mode sense blacklist how

Pat LaVarre
2003-11-14T02:39:03Z

> The point is to create as narrow an exception as possible.

Yes please.

> ...

To accomodate this device are we asking Dmitri K to give one last shot
to telling us if kernel crash, boot fs crash, or other is the result of
each of the twelve:

> > -i xC0 -y "1A 00:1C:00 C0 00" // Mode Sense (6)
> > -i xC0 -y "1A 00:3F:00 C0 00" // Mode Sense (6)
> > -i x0C -y "1A 00:00:00 0C 00" // Mode Sense (6)
> > -i x0C -y "1A 00:3F:00 0C 00" // Mode Sense (6)
> ...
> -p -i xC0 -y "5A 00 1C:00:00:00 00 00:C0 00 00:00" // Mode Sense (10)
> -p -i xC0 -y "5A 00 3F:00:00:00 00 00:C0 00 00:00" // Mode Sense (10)
> -p -i x0C -y "5A 00 00:00:00:00 00 00:0C 00 00:00" // Mode Sense (10)
> -p -i x0C -y "5A 00 3F:00:00:00 00 00:0C 00 00:00" // Mode Sense (10)
> ...
> -p -i xC4 -y "5A 00 1C:00:00:00 00 00:C4 00 00:00" // Mode Sense (10)
> -p -i xC4 -y "5A 00 3F:00:00:00 00 00:C4 00 00:00" // Mode Sense (10)
> -p -i x10 -y "5A 00 00:00:00:00 00 00:10 00 00:00" // Mode Sense (10)
> -p -i x10 -y "5A 00 3F:00:00:00 00 00:10 00 00:00" // Mode Sense (10)

?

> To blacklist bInterfaceSubClass = 0xFF, you'll have to do that at the
> usb-storage layer (not the SCSI layer). I generally object to that, but
> not very strongly -- I want usb-storage to be as simple/dumb as possible,
> to reduce to number of places where it doesn't do what the end-user
> expects. (The principle of least suprise)
>
> If the blacklist was implemented such that it only blacklisted
> direct-access devices, and only MODE_SENSE and MODE_SENSE_10, and provided
> fake sense data, then it would probably work. Messy, but it would work.

I remember already in usb-storage we intercept op x12 Inquiry (to munge
bytes[2] compliance to x02 from x00).

I figure there we can flip a bit to say we saw (byte[0] & x1F) PDT = x00
HDD/Flash. To name & allot the bit, I can follow our earlier incomplete
usb-trace efforts ... urgh, we have no googlable usb-storage archive, I
will review source and see if I remember.

Nearby I suppose we can find bInterfaceSubClass and compare to xFF.

Then if bit set and SubClass xFF and op is x1A/5A we can simulate
failure by auto sense of x12 available bytes with residue = all data and
sk asc = x 5 20 Unsupported Op.

Shall we try that next?

> ...

Ouch, one last thing: tell me again what device/interface descriptors
our usb-storage by default tries to support?

Is that bInterfaceClass ...SubClass ...Protocol = x 08 XX (00|01|50)?
Or just x 08 (00..06|FF) (00|01|50)? (Clearly it's not just the
formally defined x 08 (00..06) (00|01|50).)

I ask because if we're supporting bInterfaceSubClass via
drivers/usb/storage/unusual_devs.h then we might rather put the
blacklist there. But I'm guessing this answer is: x 08 XX (00|01|50),
so we'd rather blacklist all of x 08 FF (00|01|50), rather than growing
unusual_devs.h.

Pat LaVarre