From: David Brownell <david-b@pacbell.net>
To: linux-usb-devel@lists.sourceforge.net
Cc: Alan Stern <stern@rowland.harvard.edu>, Greg KH <greg@kroah.com>,
Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
mingo@elte.hu, linux-kernel@vger.kernel.org
Subject: Re: [linux-usb-devel] Re: Fw: Re: oops in choose_configuration()
Date: Wed, 8 Mar 2006 10:33:21 -0800 [thread overview]
Message-ID: <200603081033.21584.david-b@pacbell.net> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0603080947270.5220-100000@iolanthe.rowland.org>
I wonder if that SCSI fix (restoring a wrongly deleted mem clear) helps
get rid of this oops too?
On Wednesday 08 March 2006 7:30 am, Alan Stern wrote:
> > > a) How come we're only considering the zeroth slot in that array in here?
> >
> > We start out with the first interface setting, as we always know we have
> > one of them as per the USB spec (I think, anyone from linux-usb-devel
> > want to verify this?)
>
> In this case it wouldn't make any difference, since all the altsettings
> for a particular interface are supposed to have the same bInterfaceClass,
> bInterfaceSubClass, and bInterfaceProtocol. Although I don't think the
> USB spec actually says this anywhere..
I'd have stopped at "wouldn't make any difference"; the kernel must make
some initial choice, but userspace is free to revise it. Agreed it would
be odd if altsettings had different class/subclass/protocol, but I don't
see any good reason to make that illegal.
> The bMaxPower value could be different for different altsettings.
Erm, no; that's a per-configuration thing, not a per-altsetting thing.
It's checking the config descriptor, not the interface descriptor,
for that particular concern.
> > > b) How do we know that there's actually anything _there_? The length of
> > > that variable-sized array doesn't seem to have been stored anywhere
> > > obvious by usb_parse_configuration() and choose_configuration() doesn't
> > > check. What happens if the length was zero?
> >
> > I don't think it is allowed to be, as all USB devices have to have at
> > least 1 interface.
I think that's not true, and it would be worth verifying that it's not
a no-interfaces device even if the USB spec required it. It's trivial
to create device firmware that advertises no-interfaces, and those should
never be able to make Linux hiccup (much less oops).
> The code in usb_parse_configuration() guarantees that the number of
> entries in the altsettings array is at least 1, because it sets nalts[n]
> to 1 initially and never decreases it. The whole idea of an interface
> without altsettings makes no sense...
Right; there's always at least one setting. Calling them "alt" settings
can be confusing; any one of them could be the "main" setting.
- Dave
next prev parent reply other threads:[~2006-03-08 18:33 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060304121723.19fe9b4b.akpm@osdl.org>
[not found] ` <Pine.LNX.4.64.0603041235110.22647@g5.osdl.org>
[not found] ` <20060304213447.GA4445@kroah.com>
[not found] ` <20060304135138.613021bd.akpm@osdl.org>
[not found] ` <20060304221810.GA20011@kroah.com>
2006-03-05 23:48 ` Fw: Re: oops in choose_configuration() Andrew Morton
2006-03-06 3:27 ` Linus Torvalds
2006-03-06 8:48 ` Andrew Morton
2006-03-08 1:31 ` Greg KH
2006-03-08 1:49 ` Andrew Morton
2006-03-08 15:30 ` [linux-usb-devel] " Alan Stern
2006-03-08 18:33 ` David Brownell [this message]
2006-03-08 20:09 ` Alan Stern
2006-03-08 20:14 ` Andrew Morton
2006-03-08 20:51 ` Alan Stern
2006-03-08 20:54 ` Andrew Morton
2006-03-08 21:55 ` Alan Stern
2006-03-08 20:14 ` [PATCH] usbcore: Don't assume a USB configuration includes any interfaces Alan Stern
2006-03-06 5:00 ` Fw: Re: oops in choose_configuration() Linus Torvalds
2006-03-06 7:47 ` Mike Galbraith
2006-03-07 5:51 ` Mike Galbraith
2006-03-07 5:56 ` Nick Piggin
2006-03-06 9:14 ` Ingo Molnar
2006-03-06 10:31 ` Andrew Morton
2006-03-06 11:04 ` Jesper Juhl
2006-03-06 11:15 ` Andrew Morton
2006-03-06 15:59 ` Dave Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200603081033.21584.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=akpm@osdl.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=mingo@elte.hu \
--cc=stern@rowland.harvard.edu \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox