From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Sasha Levin <sashal@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Jiri Slaby <jirislaby@kernel.org>,
Artem Shimko <a.shimko.dev@gmail.com>,
Stepan Ionichev <sozdayvek@gmail.com>,
Serge Semin <Sergey.Semin@baikalelectronics.ru>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
Denis Arefev <arefev@swemel.ru>
Subject: Re: [PATCH 0/2 5.10] serial: 8250_dw: fix port leak on clock notifier failure
Date: Tue, 8 Sep 2026 18:59:02 -0400 [thread overview]
Message-ID: <2026-09-08-daily-reply-0010-8250-dw-5-10-correction@kernel.org> (raw)
In-Reply-To: <2026-09-08-daily-reply-0007-8250-dw-port-leak-5-10@kernel.org>
> Queued for 5.10, thanks.
I'm dropping these again...
The bug being fixed isn't reachable on 5.10. dw8250_probe() there ends the
clock notifier block with:
if (data->clk) {
err = clk_notifier_register(data->clk, &data->clk_notifier);
if (err)
dev_warn(p->dev, "Failed to set the clock notifier\n");
else
queue_work(system_unbound_wq, &data->clk_work);
}
platform_set_drvdata(pdev, data);
so a notifier registration failure warns and probe still returns 0. There is no
error return anywhere after serial8250_register_8250_port(), which is the
precondition 10fc708b4de7 ("serial: 8250_dw: unregister 8250 port if
clk_notifier_register() fails") describes when it says probe "returns the error
but leaves the 8250 port registered". No port is left behind on 5.10, so
there's nothing to unregister and no use after free.
What creates that path is patch 1/2, 57f83e5dd6a3 ("serial: 8250_dw: Use
dev_err_probe()"), which turns the warn into a return. That's a cleanup from
May 2022 with no Fixes tag and no stable Cc. It's in the base of 6.1 and newer,
which is why the fix is correct there, but 5.10 and 5.15 predate it and never
had the failing path. Taking the pair here would import the bug and its fix
together, and would also make a notifier registration failure fatal to probe on
a tree where it currently isn't, for hardware that works today.
Same reasoning applies to 5.15, so please don't send it there either.
--
Thanks,
Sasha
prev parent reply other threads:[~2026-09-08 22:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 9:36 [PATCH 0/2 5.10] serial: 8250_dw: fix port leak on clock notifier failure Denis Arefev
2026-09-08 9:36 ` [PATCH 1/2 5.10] serial: 8250_dw: Use dev_err_probe() Denis Arefev
2026-09-08 9:36 ` [PATCH 2/2 5.10] serial: 8250_dw: unregister 8250 port if clk_notifier_register() fails Denis Arefev
2026-09-08 22:39 ` [PATCH 0/2 5.10] serial: 8250_dw: fix port leak on clock notifier failure Sasha Levin
2026-09-08 22:59 ` Sasha Levin [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=2026-09-08-daily-reply-0010-8250-dw-5-10-correction@kernel.org \
--to=sashal@kernel.org \
--cc=Sergey.Semin@baikalelectronics.ru \
--cc=a.shimko.dev@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arefev@swemel.ru \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=sozdayvek@gmail.com \
--cc=stable@vger.kernel.org \
/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