From: <Nicolas.Ferre@microchip.com>
To: <liguangshuo@mail.sdu.edu.cn>, <Ludovic.Desroches@microchip.com>,
<linusw@kernel.org>, <alexandre.belloni@bootlin.com>,
<claudiu.beznea@tuxon.dev>
Cc: <linux-arm-kernel@lists.infradead.org>,
<linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<stable@vger.kernel.org>
Subject: Re: [PATCH] pinctrl: at91: Fix potential use-after-free on manual unbind
Date: Sun, 22 Nov 2026 13:00:37 +0000 [thread overview]
Message-ID: <a52a58d4-d452-42e1-be3b-db2df2211549@microchip.com> (raw)
In-Reply-To: <20261120173530.3924083-1-liguangshuo@mail.sdu.edu.cn>
On 20/11/2026 at 18:35, Guangshuo Li wrote:
> The built-in GPIO and pinctrl drivers share GPIO ranges and global bank
> pointers but provide no teardown for those relationships. Manually
> unbinding a GPIO bank frees its private data while pinctrl still holds
> its embedded range, which is accessed during pinctrl cleanup.
>
> Suppress the bind attributes for these non-removable SoC controllers
> so userspace cannot trigger this unsupported teardown.
>
> This issue was found by our static analysis tool under development.
Well, who will ever want to remove gpio or pinctrl on these platforms,
knowing that it's one and only IP for the two?
Does it have a real use-case?
I don't see the point.
Regards,
Nicolas
> Fixes: 6732ae5cb47c ("ARM: at91: add pinctrl support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
> ---
> drivers/pinctrl/pinctrl-at91.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
> index 0a57ed51d4c9..81b58a7a44be 100644
> --- a/drivers/pinctrl/pinctrl-at91.c
> +++ b/drivers/pinctrl/pinctrl-at91.c
> @@ -1911,6 +1911,7 @@ static DEFINE_NOIRQ_DEV_PM_OPS(at91_gpio_pm_ops, at91_gpio_suspend, at91_gpio_re
> static struct platform_driver at91_gpio_driver = {
> .driver = {
> .name = "gpio-at91",
> + .suppress_bind_attrs = true,
> .of_match_table = at91_gpio_of_match,
> .pm = pm_sleep_ptr(&at91_gpio_pm_ops),
> },
> @@ -1920,6 +1921,7 @@ static struct platform_driver at91_gpio_driver = {
> static struct platform_driver at91_pinctrl_driver = {
> .driver = {
> .name = "pinctrl-at91",
> + .suppress_bind_attrs = true,
> .of_match_table = at91_pinctrl_of_match,
> },
> .probe = at91_pinctrl_probe,
>
> base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
prev parent reply other threads:[~2026-11-22 13:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 17:35 [PATCH] pinctrl: at91: Fix potential use-after-free on manual unbind Guangshuo Li
2026-11-22 13:00 ` Nicolas.Ferre [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=a52a58d4-d452-42e1-be3b-db2df2211549@microchip.com \
--to=nicolas.ferre@microchip.com \
--cc=Ludovic.Desroches@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=liguangshuo@mail.sdu.edu.cn \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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