[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAB0kiBKDB=1kF4YRXckph4QG7tQbDdBMsOtcQh9+p1jtyokdPw@mail.gmail.com>
Date: Mon, 22 Jul 2024 13:11:01 -0400
From: Chris Wulff <crwulff@...il.com>
To: Alan Stern <stern@...land.harvard.edu>
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 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?
>
> Alan Stern
Powered by blists - more mailing lists