[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <97672e7a-edb4-4a00-b404-c5891319912e@rowland.harvard.edu>
Date: Mon, 22 Jul 2024 13:42:01 -0400
From: Alan Stern <stern@...land.harvard.edu>
To: Chris Wulff <crwulff@...il.com>
Cc: linux-usb@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Roy Luo <royluo@...gle.com>,
Krishna Kurapati <quic_kriskura@...cinc.com>,
Michael Grzeschik <m.grzeschik@...gutronix.de>,
yuan linyu <yuanlinyu@...onor.com>,
Paul Cercueil <paul@...pouillou.net>,
Felipe Balbi <balbi@...nel.org>, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: core: Check for unset descriptor
On Mon, Jul 22, 2024 at 01:11:01PM -0400, Chris Wulff wrote:
> On Mon, Jul 22, 2024 at 9:38 AM Alan Stern <stern@...land.harvard.edu> wrote:
> >
> > On Mon, Jul 22, 2024 at 09:00:07AM -0400, Chris Wulff wrote:
> > > On Sun, Jul 21, 2024 at 9:07 PM Alan Stern <stern@...land.harvard.edu> wrote:
> > > >
> > > > On Sun, Jul 21, 2024 at 03:20:49PM -0400, crwulff@...il.com wrote:
> > > > > From: Chris Wulff <crwulff@...il.com>
> ...
> > > The previous check was also hiding the error, and introduced a panic.
> > > I could add a printk to that error case, though it would be unassociated
> > > with the gadget that caused the problem. This function does also return
> > > an error code when it fails, so the calling function can check that and
> > > print an error.
> >
> > Okay. It wouldn't hurt to print out an error message, even if there's
> > no way to tell which gadget it refers to. A dump_stack() would help in
> > that regard, but it won't be needed if the guilty party will always be
> > pretty obvious.
> >
> > By the way, how did you manage to trigger this error? None of the
> > in-kernel gadget drivers are known to have this bug, and both the
> > gadgetfs and raw_gadget drivers prevent userspace from doing it. Were
> > you testing a gadget driver that was under development?
>
> I am working on adding alternate settings to UAC1/2 gadgets, so this really
> was a case of trying to make the failure in development easier to deal with.
> I don't believe there are any problems with existing gadgets causing this.
>
> I will add an error message and submit a new version. Perhaps
> WARN_ON_ONCE would be appropriate here to get that backtrace
> instead of a printk?
That sounds good. You should also mention in the patch description that
the purpose is to prevent undebuggable panics during driver development,
and no existing drivers will trigger the warning.
Alan Stern
Powered by blists - more mailing lists