public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 0/2] Console/stdio use after free
Date: Thu, 28 Jan 2021 18:55:51 +0200	[thread overview]
Message-ID: <YBLsl2ohx8Ya9AhB@smile.fi.intel.com> (raw)
In-Reply-To: <20210128131240.13190-1-nsaenzjulienne@suse.de>

On Thu, Jan 28, 2021 at 02:12:38PM +0100, Nicolas Saenz Julienne wrote:
> With today's master, 70c2525c0d3c ('IOMUX: Stop dropped consoles')
> introduces a use after free in usb_kbd_remove():
> 
> - usbkbd's stdio device is de-registered with stdio_deregister_dev(),
>   the struct stdio_dev is freed.
> 
> - iomux_doenv() is called, usbkbd removed from the console list, and
>   console_stop() is called on the struct stdio_dev pointer that no
>   longer exists.
> 
> This series mitigates this by making sure the pointer is really a stdio
> device prior performing the stop operation. It's not ideal, but I
> couldn't figure out a nicer way to fix this.

I have just sent another approach, can you test it instead, please?

-- 
With Best Regards,
Andy Shevchenko

      parent reply	other threads:[~2021-01-28 16:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 13:12 [PATCH v2 0/2] Console/stdio use after free Nicolas Saenz Julienne
2021-01-28 13:12 ` [PATCH v2 1/2] stdio: Introduce stdio_valid() Nicolas Saenz Julienne
2021-02-01 20:43   ` Simon Glass
2021-01-28 13:12 ` [PATCH v2 2/2] console: Don't start/stop console if stdio device invalid Nicolas Saenz Julienne
2021-01-28 15:52   ` Andy Shevchenko
2021-01-29  8:50     ` Matthias Brugger
2021-02-01 19:29       ` Tom Rini
2021-02-03  9:50         ` Andy Shevchenko
2021-02-05 17:06           ` Andy Shevchenko
2021-02-05 17:50             ` Tom Rini
2021-02-05 18:07               ` Tom Rini
2021-02-05 19:31                 ` Andy Shevchenko
2021-02-05 20:47                   ` Tom Rini
2021-02-01 20:18   ` Simon Glass
2021-01-28 16:55 ` 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=YBLsl2ohx8Ya9AhB@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