All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karl Mehltretter <kmehltretter@gmail.com>
To: sashiko-reviews@lists.linux.dev
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH 4/4] serial: imx: clear imx_uart_ports[] entry on probe failure and removal
Date: Mon, 20 Jul 2026 00:02:09 +0200	[thread overview]
Message-ID: <al1CmLgNC4Tf5amR@gmail.com> (raw)
In-Reply-To: <20260719162850.043B41F000E9@smtp.kernel.org>

On Sun, Jul 19, 2026 at 04:28:49PM +0100, sashiko-bot@kernel.org wrote:
> >  	uart_remove_one_port(&imx_uart_uart_driver, &sport->port);
> > +	imx_uart_ports[line] = NULL;
> 
> [Severity: High]
> Does clearing imx_uart_ports[] after uart_remove_one_port() create a race
> condition with concurrent sibling probes?
> 

Yes, this is valid, but the underlying issue is not new.

Before this change, a dangling pointer remained in the table and could
be used by a later sibling probe.

This change narrows it to a window where a NULL-pointer dereference is
possible.

I'll send a v2 with a driver-wide mutex around the table updates and
port add/remove.

Thanks,
Karl

      reply	other threads:[~2026-07-19 22:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-19 16:08 [PATCH 0/4] serial: fix console lifetime bugs on failed bind and removal Karl Mehltretter
2026-07-19 16:08 ` [PATCH 1/4] serial: core: do fallible allocations before the console can be registered Karl Mehltretter
2026-07-19 16:08 ` [PATCH 2/4] serial: core: clear freed pointers on uart_register_driver() failure Karl Mehltretter
2026-07-19 16:08 ` [PATCH 3/4] tty: don't oops in tty_unregister_device() when no cdev is registered Karl Mehltretter
2026-07-19 16:08 ` [PATCH 4/4] serial: imx: clear imx_uart_ports[] entry on probe failure and removal Karl Mehltretter
2026-07-19 16:28   ` sashiko-bot
2026-07-19 22:02     ` Karl Mehltretter [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=al1CmLgNC4Tf5amR@gmail.com \
    --to=kmehltretter@gmail.com \
    --cc=Frank.Li@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.