From: Karl Mehltretter <kmehltretter@gmail.com>
To: sashiko-reviews@lists.linux.dev
Cc: Frank.Li@kernel.org, imx@lists.linux.dev
Subject: Re: [PATCH v2 4/4] serial: imx: serialize imx_uart_ports[] lifetime
Date: Fri, 31 Jul 2026 16:59:19 +0200 [thread overview]
Message-ID: <amy15DcfY_ox0Is4@gmail.com> (raw)
In-Reply-To: <20260719222501.CB4CB1F000E9@smtp.kernel.org>
On Sun, Jul 19, 2026 at 10:25:00PM +0100, sashiko-bot@kernel.org wrote:
> [Severity: High]
> If a duplicate UART alias is probed, such as from a misconfigured device
> tree, does this unconditionally overwrite an already active port's entry
> in imx_uart_ports?
>
> When uart_add_one_port() subsequently fails for the duplicate, this error
> path sets the entry to NULL. The original port remains active, but will
> console callbacks that rely on imx_uart_ports[] encounter a NULL pointer
> dereference and crash the system?
>
The existing code already overwrites the active slot.
If uart_add_one_port() fails, this leaves the slot pointing to the freed
duplicate port. This patch changes that failure mode to a NULL pointer.
I'll reject an occupied slot in v3.
Thanks,
Karl
next prev parent reply other threads:[~2026-07-31 14:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-19 22:10 [PATCH v2 0/4] serial: fix console lifetime bugs on failed bind and removal Karl Mehltretter
2026-07-19 22:10 ` [PATCH v2 1/4] serial: core: do fallible allocations before the console can be registered Karl Mehltretter
2026-07-30 14:28 ` Greg Kroah-Hartman
2026-07-31 12:37 ` Karl Mehltretter
2026-07-19 22:10 ` [PATCH v2 4/4] serial: imx: serialize imx_uart_ports[] lifetime Karl Mehltretter
2026-07-19 22:25 ` sashiko-bot
2026-07-31 14:59 ` Karl Mehltretter [this message]
2026-07-30 14:31 ` Greg Kroah-Hartman
2026-07-31 13:54 ` Karl Mehltretter
2026-07-30 19:02 ` Frank Li
2026-07-31 14:40 ` Karl Mehltretter
2026-07-31 15:28 ` Frank Li
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=amy15DcfY_ox0Is4@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox