From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: u-boot@lists.denx.de
Subject: [PATCH v1] usb: kbd: destroy device after console is stopped
Date: Thu, 11 Feb 2021 17:11:54 +0200 [thread overview]
Message-ID: <YCVJOuUm6NN1l+xj@smile.fi.intel.com> (raw)
In-Reply-To: <b24fbc237211debdb75249bad0f470ebd82e2991.camel@suse.de>
On Wed, Feb 03, 2021 at 01:25:38PM +0100, Nicolas Saenz Julienne wrote:
> Andy, Tony,
> Sorry for my late reply, but I got a bad cold.
I hope you are doing well.
Unfortunately I haven't heard from you lately, so I have decided to send out
whatever I have as a patch series. You are Cc'ed on the last patch (it has
prerequisites, so better to apply entire series for easy going).
That said, I have dropped the 'iomux' branch from my public tree.
> On Thu, 2021-01-28 at 15:46 -0500, Tom Rini wrote:
> > On Thu, Jan 28, 2021 at 10:35:37PM +0200, Andy Shevchenko wrote:
> > > On Thu, Jan 28, 2021 at 06:19:56PM +0100, Nicolas Saenz Julienne wrote:
> > > > Hi Andy,
> > > >
> > > > On Thu, 2021-01-28 at 18:55 +0200, Andy Shevchenko wrote:
> > > > > In case of IOMUX enabled it assumes that console devices in the list
> > > > > are available to get them stopped properly via ->stop() callback.
> > > > > However, the USB keyboard driver violates this assumption and tries
> > > > > to play tricks so the device get destroyed while being listed as
> > > > > an active console.
> > > > >
> > > > > Swap the order of device deregistration and IOMUX update to avoid
> > > > > the use-after-free.
> > > > >
> > > > > Fixes: 3cbcb2892809 ("usb: Fix usb_kbd_deregister when console-muxing is used")
> > > > > Fixes: 8a8348703081 ("dm: usb: Add a remove() method for USB keyboards")
> > > > > Reported-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> > > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > > ---
> > > > > v2: Nicolas, can you test this one instead of yours?
> > > >
> > > > Sadly this doesn't seem to work, and breaks a bunch of other tests in the
> > > > process. You can try it yourself by running: './test/py/test.py --bd sandbox
> > > > --build'
> > >
> > > Now I'm able to run test cases. I see some of them failing even without my
> > > patch, but few definitely related. Can you give a list of failed ones on your
> > > side? I can compare that we are on the same page here.
> >
> > Running this here on sandbox I get:
> > FAILED test/py/tests/test_ut.py::test_ut[ut_dm_bootcount] - OSError: [Errno 5] Input/output ...
> > FAILED test/py/tests/test_ut.py::test_ut[ut_dm_usb_flash] - OSError: [Errno 5] Input/output ...
> > FAILED test/py/tests/test_ut.py::test_ut[ut_dm_usb_multi] - OSError: [Errno 5] Input/output ...
> > FAILED test/py/tests/test_ut.py::test_ut[ut_dm_video_ansi] - OSError: [Errno 5] Input/output...
>
> This is what I'm seeing too.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2021-02-11 15:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-28 16:55 [PATCH v1] usb: kbd: destroy device after console is stopped Andy Shevchenko
2021-01-28 17:19 ` Nicolas Saenz Julienne
2021-01-28 17:46 ` Andy Shevchenko
2021-01-28 17:52 ` Andy Shevchenko
2021-01-28 17:58 ` Tom Rini
2021-01-28 18:18 ` Andy Shevchenko
2021-01-28 18:24 ` Tom Rini
2021-01-28 18:44 ` Andy Shevchenko
2021-01-28 18:10 ` Andy Shevchenko
2021-01-28 20:35 ` Andy Shevchenko
2021-01-28 20:46 ` Tom Rini
2021-01-28 21:52 ` Andy Shevchenko
2021-01-28 21:56 ` Andy Shevchenko
2021-02-03 12:25 ` Nicolas Saenz Julienne
2021-02-11 15:11 ` Andy Shevchenko [this message]
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=YCVJOuUm6NN1l+xj@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=u-boot@lists.denx.de \
/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