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 2/2] console: Don't start/stop console if stdio device invalid
Date: Fri, 5 Feb 2021 19:06:54 +0200	[thread overview]
Message-ID: <YB17Lli4CgbarGAj@smile.fi.intel.com> (raw)
In-Reply-To: <CAHp75VdZKz=gt-5WU868CTJ_zmJuKLWCMUFyDVMutH7izR1bvQ@mail.gmail.com>

On Wed, Feb 03, 2021 at 11:50:53AM +0200, Andy Shevchenko wrote:
> On Mon, Feb 1, 2021 at 9:29 PM Tom Rini <trini@konsulko.com> wrote:
> >
> > On Fri, Jan 29, 2021 at 09:50:50AM +0100, Matthias Brugger wrote:
> > >
> > >
> > > On 28/01/2021 16:52, Andy Shevchenko wrote:
> > > > On Thu, Jan 28, 2021 at 02:12:40PM +0100, Nicolas Saenz Julienne wrote:
> > > >> Don't start/stop an stdio device that might have been already freed.
> > > >>
> > > >> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> > > >> Fixes: 70c2525c0d3c ("IOMUX: Stop dropped consoles")
> > > >
> > > > ...
> > > >
> > > >> +  /*
> > > >> +   * TODO: This is a workaround to avoid accessing freed memory:
> > > >> +   * console_stop() might be called on an stdio_dev that has already been
> > > >> +   * de-registered, due to the fact that stdio_deregister_dev()
> > > >> +   * doesn't update the global console_devices array.
> > > >> +   */
> > > >
> > > > I see now. I think I have experienced this issue from time to time. I will look
> > > > at it. Tom, Simon, please hold on applying these for a while.
> > > >
> > >
> > > Just for the notes, the failing tests hold back Nicolas series to support
> > > RPi400/CM4 [1] as it does not run the new tests added successfully. If it takes
> > > a long time to fix the test environment, I'd vote to take this series as a
> > > stop-gap so that we can support that HW in the next release.
> >
> > Andy, since you're working on a better solution, do you want more time
> > for that or should I pick this series up for now and you can revert it
> > as part of your better fix?  Thanks!
> 
> Sorry for the delayed reply. Give me a couple of days, and if I will
> come up without any (good) solution, apply this series.

Okay, as promised, I prepared a branch [1] with new approach, but while I will
be busy with other stuff, I would like you to test on real hardware and tell if
it helps. At least it passes test cases.

If it works, I would like to get a Tested-by tag and will prepare and submit
the formal series.

[1]: https://github.com/andy-shev/u-boot/tree/iomux

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2021-02-05 17:06 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 [this message]
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 ` [PATCH v2 0/2] Console/stdio use after free Andy Shevchenko

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=YB17Lli4CgbarGAj@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