All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] pinctrl: Fix Critical and High issues reported by Sashiko (batch 3)
@ 2026-12-02  9:29 Lee Jones
  2026-12-02  9:29 ` [PATCH 01/12] pinctrl: stm32: Validate npins against STM32_GPIO_PINS_PER_BANK Lee Jones
                   ` (11 more replies)
  0 siblings, 12 replies; 22+ messages in thread
From: Lee Jones @ 2026-12-02  9:29 UTC (permalink / raw)
  To: lee
  Cc: linux-kernel, Alexandre Torgue, Andre Przywara, Andy Shevchenko,
	Antonio Borneo, Bartosz Golaszewski, Bjorn Helgaas, Chen-Yu Tsai,
	Danilo Krummrich, Dmitry Osipenko, Dong Aisheng, Fabien Dessenne,
	Fabio Estevam, Frank Li, Gary Bisson, Gregory Bean, Haibo Chen,
	Haojian Zhuang, Husaini Zulkifli, imx, Jacky Bai, Jacky Huang,
	Jernej Skrabec, Jonathan Hunter, Ju Nan, Linus Walleij,
	linux-arm-kernel, linux-gpio, linux-omap, linux-stm32,
	linux-sunxi, linux-tegra, Lokesh Vutla, Mark Gross,
	Maxime Coquelin, Maxime Ripard, Mehmet Fide, Neil Armstrong,
	Nishanth Menon, NXP S32 Linux Team, Pengutronix Kernel Team,
	Rob Herring, Rosen Penev, Samuel Holland, Sascha Hauer,
	Shan-Chun Hung, Shawn Guo, Sowjanya D, Sowjanya Komatineni,
	Takashi Sakamoto, Thierry Reding, Tony Lindgren,
	Uwe Kleine-König (The Capable Hub), Vijayakannan Ayyathurai,
	Vineetha G. Jaya Kumaran

These issues were reported by Sashiko.

This is the third batch of Critical and High severity pinctrl fixes,
rebased onto pinctrl/for-next.  It addresses out-of-bounds array and
MMIO accesses, missing locking around generic group/function trees and
shared hardware registers, a shared pin configuration double-free, DT
error propagation, a zero-bank dereference, and IRQ registration
ordering.

Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Antonio Borneo <antonio.borneo@foss.st.com>
Cc: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Chen-Yu Tsai <wens@kernel.org>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Dmitry Osipenko <digetx@gmail.com>
Cc: Dong Aisheng <aisheng.dong@nxp.com>
Cc: Fabien Dessenne <fabien.dessenne@foss.st.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Frank Li <Frank.Li@nxp.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>
Cc: Gregory Bean <gbean@codeaurora.org>
Cc: Haibo Chen <haibo.chen@nxp.com>
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>
Cc: Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Cc: imx@lists.linux.dev
Cc: Jacky Bai <ping.bai@nxp.com>
Cc: Jacky Huang <ychuang3@nuvoton.com>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Ju Nan <junan76@163.com>
Cc: Linus Walleij <linusw@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-gpio@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-sunxi@lists.linux.dev
Cc: linux-tegra@vger.kernel.org
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Cc: Mark Gross <mgross@linux.intel.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Mehmet Fide <mehmet.fide@screeningeagle.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Nishanth Menon <nm@ti.com>
Cc: NXP S32 Linux Team <s32@nxp.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Rob Herring <robh@kernel.org>
Cc: Rosen Penev <rosenp@gmail.com>
Cc: Samuel Holland <samuel@sholland.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shan-Chun Hung <schung@nuvoton.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Sowjanya D <lakshmi.sowjanya.d@intel.com>
Cc: Sowjanya Komatineni <skomatineni@nvidia.com>
Cc: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: Thierry Reding <thierry.reding@kernel.org>
Cc: Tony Lindgren <tony@atomide.com>
Cc: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: Vijayakannan Ayyathurai <vijayakannan.ayyathurai@intel.com>
Cc: "Vineetha G. Jaya Kumaran" <vineetha.g.jaya.kumaran@intel.com>

Lee Jones (12):
  pinctrl: stm32: Validate npins against STM32_GPIO_PINS_PER_BANK
  pinctrl: imx: Validate pin_id in imx_pinctrl_parse_pin_mmio()
  pinctrl: single: Protect group and function updates with
    pctldev->mutex
  pinctrl: imx: Propagate DT parsing errors in imx_pinctrl_probe_dt()
  pinctrl: tegra: Require at least one register bank in
    tegra_pinctrl_probe()
  pinctrl: imx: Serialise MMIO register updates with a spinlock
  pinctrl: nuvoton: ma35: Avoid double free of shared pin configs
  pinctrl: keembay: Check src before calling keembay_find_free_slot()
  pinctrl: ti: iodelay: Protect generic group addition with
    pctldev->mutex
  pinctrl: sunxi: Serialise per-bank regulator request and free
  pinctrl: stm32: Protect irqmux restore with hwspinlock during resume
  pinctrl: sx150x: Register threaded IRQ after adding GPIO chip

 drivers/pinctrl/freescale/pinctrl-imx.c     | 64 +++++++++++++++------
 drivers/pinctrl/freescale/pinctrl-imx.h     |  2 +
 drivers/pinctrl/freescale/pinctrl-imx7ulp.c |  3 +
 drivers/pinctrl/freescale/pinctrl-imx8ulp.c |  3 +
 drivers/pinctrl/freescale/pinctrl-vf610.c   |  3 +
 drivers/pinctrl/nuvoton/pinctrl-ma35.c      | 21 ++++++-
 drivers/pinctrl/pinctrl-keembay.c           |  6 +-
 drivers/pinctrl/pinctrl-single.c            | 12 ++--
 drivers/pinctrl/pinctrl-sx150x.c            | 12 ++--
 drivers/pinctrl/stm32/pinctrl-stm32.c       | 33 ++++++++++-
 drivers/pinctrl/sunxi/pinctrl-sunxi.c       | 17 +++---
 drivers/pinctrl/sunxi/pinctrl-sunxi.h       |  3 +
 drivers/pinctrl/tegra/pinctrl-tegra.c       |  2 +
 drivers/pinctrl/ti/pinctrl-ti-iodelay.c     |  7 ++-
 14 files changed, 149 insertions(+), 39 deletions(-)

-- 
2.56.1.911.g883d8bcb20-goog


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 01/12] pinctrl: stm32: Validate npins against STM32_GPIO_PINS_PER_BANK
  2026-12-02  9:29 [PATCH 00/12] pinctrl: Fix Critical and High issues reported by Sashiko (batch 3) Lee Jones
@ 2026-12-02  9:29 ` Lee Jones
  2026-12-02 16:13   ` Antonio Borneo
  2026-12-02  9:29 ` [PATCH 02/12] pinctrl: imx: Validate pin_id in imx_pinctrl_parse_pin_mmio() Lee Jones
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Lee Jones @ 2026-12-02  9:29 UTC (permalink / raw)
  To: lee, Antonio Borneo, Linus Walleij, Maxime Coquelin,
	Alexandre Torgue, Ju Nan, Fabien Dessenne, linux-gpio,
	linux-stm32, linux-arm-kernel, linux-kernel
  Cc: stable

stm32_gpiolib_register_bank() computes npins from the device tree
"gpio-ranges" property as args.args[0] + args.args[2] without checking
that the resulting value fits within STM32_GPIO_PINS_PER_BANK (16).
Because bank->pin_backup[] is a fixed-size array of
STM32_GPIO_PINS_PER_BANK elements and the hardware registers only have
16 lines per bank, a larger npins value leads to out-of-bounds array
accesses and shift overflows.

Validate that npins is within 1..STM32_GPIO_PINS_PER_BANK.

Fixes: b67210cc217f ("pinctrl: stm32: consider the GPIO offset to expose all the GPIO lines")
Closes: https://sashiko.dev/#/bug/linux-efdf6da1-70b0-4c56-add9-2bc97a4c140d
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/pinctrl/stm32/pinctrl-stm32.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index bf16e5814bf8..01c8a646d9a0 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -1657,13 +1657,26 @@ static int stm32_gpiolib_register_bank(struct stm32_pinctrl *pctl, struct fwnode
 		bank->gpio_chip.base = args.args[1];
 
 		/* get the last defined gpio line (offset + nb of pins) */
+		if (args.args[0] >= STM32_GPIO_PINS_PER_BANK ||
+		    args.args[2] > STM32_GPIO_PINS_PER_BANK - args.args[0]) {
+			fwnode_handle_put(args.fwnode);
+			return -EINVAL;
+		}
 		npins = args.args[0] + args.args[2];
 		fwnode_handle_put(args.fwnode);
 
 		while (!fwnode_property_get_reference_args(fwnode, "gpio-ranges", NULL, 3, ++i, &args)) {
+			if (args.args[0] >= STM32_GPIO_PINS_PER_BANK ||
+			    args.args[2] > STM32_GPIO_PINS_PER_BANK - args.args[0]) {
+				fwnode_handle_put(args.fwnode);
+				return -EINVAL;
+			}
 			npins = max(npins, (int)(args.args[0] + args.args[2]));
 			fwnode_handle_put(args.fwnode);
 		}
+
+		if (!npins)
+			return -EINVAL;
 	} else {
 		bank_nr = pctl->nbanks;
 		bank->gpio_chip.base = bank_nr * STM32_GPIO_PINS_PER_BANK;
-- 
2.56.1.911.g883d8bcb20-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 02/12] pinctrl: imx: Validate pin_id in imx_pinctrl_parse_pin_mmio()
  2026-12-02  9:29 [PATCH 00/12] pinctrl: Fix Critical and High issues reported by Sashiko (batch 3) Lee Jones
  2026-12-02  9:29 ` [PATCH 01/12] pinctrl: stm32: Validate npins against STM32_GPIO_PINS_PER_BANK Lee Jones
@ 2026-12-02  9:29 ` Lee Jones
  2026-12-02  9:50   ` sashiko-bot
  2026-12-02 17:17   ` Frank Li
  2026-12-02  9:29 ` [PATCH 03/12] pinctrl: single: Protect group and function updates with pctldev->mutex Lee Jones
                   ` (9 subsequent siblings)
  11 siblings, 2 replies; 22+ messages in thread
From: Lee Jones @ 2026-12-02  9:29 UTC (permalink / raw)
  To: lee, Dong Aisheng, Fabio Estevam, Frank Li, Jacky Bai,
	Pengutronix Kernel Team, NXP S32 Linux Team, Linus Walleij,
	Sascha Hauer, Mehmet Fide, Shawn Guo, linux-gpio, imx,
	linux-arm-kernel, linux-kernel
  Cc: stable

imx_pinctrl_parse_pin_mmio() derives *pin_id from mux_reg / 4 or
conf_reg / 4 and uses it directly to index ipctl->pin_regs[*pin_id] and
info->pins[*pin_id] without bounds checking against info->npins.  If a
device tree entry specifies an out-of-range register offset or sets both
mux_reg and conf_reg to 0 on a SoC without ZERO_OFFSET_VALID (making
conf_reg == -1 and *pin_id == 0x3fffffff), this results in an
out-of-bounds memory access.

Validate that *pin_id is less than info->npins and return -EINVAL on
invalid entries.

Fixes: e16415313c9b ("pinctrl: imx: move hard-coding data into device tree")
Closes: https://sashiko.dev/#/bug/linux-b67db85c-1fa1-4c97-9932-88c575b568f2
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/pinctrl/freescale/pinctrl-imx.c | 32 ++++++++++++++++++-------
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index ebcce9aeac8c..0a825f58448f 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -502,15 +502,16 @@ static const struct pinconf_ops imx_pinconf_ops = {
 #define FSL_PIN_SHARE_SIZE 20
 #define FSL_SCU_PIN_SIZE 12
 
-static void imx_pinctrl_parse_pin_mmio(struct imx_pinctrl *ipctl,
-				       unsigned int *pin_id, struct imx_pin *pin,
-				       const __be32 **list_p,
-				       struct device_node *np)
+static int imx_pinctrl_parse_pin_mmio(struct imx_pinctrl *ipctl,
+				      unsigned int *pin_id, struct imx_pin *pin,
+				      const __be32 **list_p,
+				      struct device_node *np)
 {
 	const struct imx_pinctrl_soc_info *info = ipctl->info;
 	struct imx_pin_mmio *pin_mmio = &pin->conf.mmio;
 	struct imx_pin_reg *pin_reg;
 	const __be32 *list = *list_p;
+	unsigned int id;
 	u32 mux_reg, conf_reg;
 	u32 config;
 
@@ -527,7 +528,14 @@ static void imx_pinctrl_parse_pin_mmio(struct imx_pinctrl *ipctl,
 			conf_reg = -1;
 	}
 
-	*pin_id = (mux_reg != -1) ? mux_reg / 4 : conf_reg / 4;
+	id = (mux_reg != -1) ? mux_reg / 4 : conf_reg / 4;
+	if (id >= info->npins) {
+		dev_err(ipctl->dev, "Invalid pin id %u in node %pOF\n",
+			id, np);
+		return -EINVAL;
+	}
+
+	*pin_id = id;
 	pin_reg = &ipctl->pin_regs[*pin_id];
 	pin->pin = *pin_id;
 	pin_reg->mux_reg = mux_reg;
@@ -547,6 +555,8 @@ static void imx_pinctrl_parse_pin_mmio(struct imx_pinctrl *ipctl,
 
 	dev_dbg(ipctl->dev, "%s: 0x%x 0x%08lx", info->pins[*pin_id].name,
 			     pin_mmio->mux_mode, pin_mmio->config);
+
+	return 0;
 }
 
 static int imx_pinctrl_parse_groups(struct device_node *np,
@@ -611,10 +621,16 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
 
 	for (i = 0; i < grp->grp.npins; i++) {
 		pin = &((struct imx_pin *)(grp->data))[i];
-		if (info->flags & IMX_USE_SCU)
+		if (info->flags & IMX_USE_SCU) {
 			info->imx_pinctrl_parse_pin(ipctl, &pins[i], pin, &list);
-		else
-			imx_pinctrl_parse_pin_mmio(ipctl, &pins[i], pin, &list, np);
+		} else {
+			int ret;
+
+			ret = imx_pinctrl_parse_pin_mmio(ipctl, &pins[i], pin,
+							 &list, np);
+			if (ret)
+				return ret;
+		}
 	}
 
 	return 0;
-- 
2.56.1.911.g883d8bcb20-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 03/12] pinctrl: single: Protect group and function updates with pctldev->mutex
  2026-12-02  9:29 [PATCH 00/12] pinctrl: Fix Critical and High issues reported by Sashiko (batch 3) Lee Jones
  2026-12-02  9:29 ` [PATCH 01/12] pinctrl: stm32: Validate npins against STM32_GPIO_PINS_PER_BANK Lee Jones
  2026-12-02  9:29 ` [PATCH 02/12] pinctrl: imx: Validate pin_id in imx_pinctrl_parse_pin_mmio() Lee Jones
@ 2026-12-02  9:29 ` Lee Jones
  2026-12-02 14:08   ` Bartosz Golaszewski
  2026-12-02  9:29 ` [PATCH 04/12] pinctrl: imx: Propagate DT parsing errors in imx_pinctrl_probe_dt() Lee Jones
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Lee Jones @ 2026-12-02  9:29 UTC (permalink / raw)
  To: lee, Tony Lindgren, Haojian Zhuang, Linus Walleij,
	Andy Shevchenko, linux-arm-kernel, linux-omap, linux-gpio,
	linux-kernel
  Cc: stable

pcs_parse_one_pinctrl_entry() and pcs_parse_bits_in_pinctrl_entry()
mutate pcs->pctl->pin_function_tree and pcs->pctl->pin_group_tree via
pcs_add_function(), pinctrl_generic_add_group(), and their removal
helpers while holding only the driver-private pcs->mutex.  However, the
pinctrl core debugfs readers and teardown paths traverse and modify
those radix trees under pctldev->mutex, leaving concurrent readers and
writers racing without a shared lock.

Acquire pcs->pctl->mutex instead of pcs->mutex in both parsing
functions so all generic group and function tree operations are
serialised against the pinctrl core.

Fixes: a4ab10860723 ("pinctrl: single: Fix group and function selector use")
Closes: https://sashiko.dev/#/bug/linux-e32b7426-4575-4354-a2fe-409cde3480ce
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/pinctrl/pinctrl-single.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index e351cdf50669..618f8fc6ee6c 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -1059,7 +1059,7 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs,
 	}
 
 	pgnames[0] = np->name;
-	mutex_lock(&pcs->mutex);
+	mutex_lock(&pcs->pctl->mutex);
 	fsel = pcs_add_function(pcs, &function, np->name, vals, found,
 				pgnames, 1);
 	if (fsel < 0) {
@@ -1102,7 +1102,7 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs,
 		devm_kfree(pcs->dev, function);
 		devm_kfree(pcs->dev, pgnames);
 	}
-	mutex_unlock(&pcs->mutex);
+	mutex_unlock(&pcs->pctl->mutex);
 
 	return 0;
 
@@ -1118,7 +1118,7 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs,
 	if (pinmux_generic_get_function(pcs->pctl, fsel)->data == function)
 		pinmux_generic_remove_function(pcs->pctl, fsel);
 free_pins:
-	mutex_unlock(&pcs->mutex);
+	mutex_unlock(&pcs->pctl->mutex);
 	devm_kfree(pcs->dev, pins);
 
 free_vals:
@@ -1229,7 +1229,7 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
 	}
 
 	pgnames[0] = np->name;
-	mutex_lock(&pcs->mutex);
+	mutex_lock(&pcs->pctl->mutex);
 	fsel = pcs_add_function(pcs, &function, np->name, vals, found,
 				pgnames, 1);
 	if (fsel < 0) {
@@ -1254,7 +1254,7 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
 		devm_kfree(pcs->dev, function);
 		devm_kfree(pcs->dev, pgnames);
 	}
-	mutex_unlock(&pcs->mutex);
+	mutex_unlock(&pcs->pctl->mutex);
 
 	return 0;
 
@@ -1263,7 +1263,7 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
 	if (pinmux_generic_get_function(pcs->pctl, fsel)->data == function)
 		pinmux_generic_remove_function(pcs->pctl, fsel);
 free_pins:
-	mutex_unlock(&pcs->mutex);
+	mutex_unlock(&pcs->pctl->mutex);
 	devm_kfree(pcs->dev, pins);
 
 free_vals:
-- 
2.56.1.911.g883d8bcb20-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 04/12] pinctrl: imx: Propagate DT parsing errors in imx_pinctrl_probe_dt()
  2026-12-02  9:29 [PATCH 00/12] pinctrl: Fix Critical and High issues reported by Sashiko (batch 3) Lee Jones
                   ` (2 preceding siblings ...)
  2026-12-02  9:29 ` [PATCH 03/12] pinctrl: single: Protect group and function updates with pctldev->mutex Lee Jones
@ 2026-12-02  9:29 ` Lee Jones
  2026-12-02 17:20   ` Frank Li
  2026-12-02  9:29 ` [PATCH 05/12] pinctrl: tegra: Require at least one register bank in tegra_pinctrl_probe() Lee Jones
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Lee Jones @ 2026-12-02  9:29 UTC (permalink / raw)
  To: lee, Dong Aisheng, Fabio Estevam, Frank Li, Jacky Bai,
	Pengutronix Kernel Team, NXP S32 Linux Team, Linus Walleij,
	Sascha Hauer, Mehmet Fide, Gary Bisson, linux-gpio, imx,
	linux-arm-kernel, linux-kernel
  Cc: stable

imx_pinctrl_parse_functions() inserts each group descriptor into
pctl->pin_group_tree before calling imx_pinctrl_parse_groups() and
ignores the return value of imx_pinctrl_parse_groups().  Likewise,
imx_pinctrl_probe_dt() ignores the return value of
imx_pinctrl_parse_functions().  If a device tree group node is malformed
or a memory allocation fails, partially initialised group descriptors
with NULL data pointers remain registered in the radix tree and cause a
NULL pointer dereference when the pinctrl core or debugfs accesses the
group.

Parse each group before inserting it into pctl->pin_group_tree and
propagate errors from imx_pinctrl_parse_groups() and
imx_pinctrl_parse_functions().  Return 0 when a function node has no
groups so boards with empty controller nodes continue to probe as
before.

Fixes: e566fc11ea76 ("pinctrl: imx: use generic pinctrl helpers for managing groups")
Closes: https://sashiko.dev/#/bug/linux-70c60bc4-5868-4c94-b1bb-7073f7a3316c
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/pinctrl/freescale/pinctrl-imx.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index 0a825f58448f..b1114dce3485 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -658,7 +658,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
 	func->ngroups = of_get_child_count(np);
 	if (func->ngroups == 0) {
 		dev_info(ipctl->dev, "no groups defined in %pOF\n", np);
-		return -EINVAL;
+		return 0;
 	}
 
 	group_names = devm_kzalloc_objs(ipctl->dev, *group_names, func->ngroups);
@@ -679,6 +679,10 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
 		if (!grp)
 			return -ENOMEM;
 
+		ret = imx_pinctrl_parse_groups(child, grp, ipctl, i++);
+		if (ret)
+			return ret;
+
 		mutex_lock(&ipctl->mutex);
 		/*
 		 * FIXME: This should use pinctrl_generic_add_group() and not
@@ -687,8 +691,6 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
 		radix_tree_insert(&pctl->pin_group_tree,
 				  ipctl->group_index++, grp);
 		mutex_unlock(&ipctl->mutex);
-
-		imx_pinctrl_parse_groups(child, grp, ipctl, i++);
 	}
 
 	return 0;
@@ -718,7 +720,6 @@ static int imx_pinctrl_probe_dt(struct platform_device *pdev,
 				struct imx_pinctrl *ipctl)
 {
 	struct device_node *np = pdev->dev.of_node;
-	struct device_node *child;
 	struct pinctrl_dev *pctl = ipctl->pctl;
 	u32 nfuncs = 0;
 	u32 i = 0;
@@ -743,16 +744,21 @@ static int imx_pinctrl_probe_dt(struct platform_device *pdev,
 		pctl->num_groups = of_get_child_count(np);
 	} else {
 		pctl->num_groups = 0;
-		for_each_child_of_node(np, child)
+		for_each_child_of_node_scoped(np, child)
 			pctl->num_groups += of_get_child_count(child);
 	}
 
 	if (flat_funcs) {
-		imx_pinctrl_parse_functions(np, ipctl, 0);
+		return imx_pinctrl_parse_functions(np, ipctl, 0);
 	} else {
+		int ret;
+
 		i = 0;
-		for_each_child_of_node(np, child)
-			imx_pinctrl_parse_functions(child, ipctl, i++);
+		for_each_child_of_node_scoped(np, child) {
+			ret = imx_pinctrl_parse_functions(child, ipctl, i++);
+			if (ret)
+				return ret;
+		}
 	}
 
 	return 0;
-- 
2.56.1.911.g883d8bcb20-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 05/12] pinctrl: tegra: Require at least one register bank in tegra_pinctrl_probe()
  2026-12-02  9:29 [PATCH 00/12] pinctrl: Fix Critical and High issues reported by Sashiko (batch 3) Lee Jones
                   ` (3 preceding siblings ...)
  2026-12-02  9:29 ` [PATCH 04/12] pinctrl: imx: Propagate DT parsing errors in imx_pinctrl_probe_dt() Lee Jones
@ 2026-12-02  9:29 ` Lee Jones
  2026-12-02  9:30 ` [PATCH 06/12] pinctrl: imx: Serialise MMIO register updates with a spinlock Lee Jones
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 22+ messages in thread
From: Lee Jones @ 2026-12-02  9:29 UTC (permalink / raw)
  To: lee, Linus Walleij, Thierry Reding, Jonathan Hunter, Rosen Penev,
	Dmitry Osipenko, Sowjanya Komatineni, linux-gpio, linux-tegra,
	linux-kernel
  Cc: stable

tegra_pinctrl_probe() counts IORESOURCE_MEM resources without checking
that at least one memory bank is present.  If a device tree node omits
the reg property, pmx->nbanks is 0, pmx->regs is allocated as
ZERO_SIZE_PTR, and tegra_pinctrl_resume() unconditionally dereferences
pmx->regs[0] to flush writes.

Return -ENODEV from tegra_pinctrl_probe() if pmx->nbanks is 0.

Fixes: a4873accca05 ("pinctrl: tegra: Flush pinctrl writes during resume")
Closes: https://sashiko.dev/#/bug/linux-dc81d6b3-2c40-4253-b0f9-393c796e6adb
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/pinctrl/tegra/pinctrl-tegra.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c b/drivers/pinctrl/tegra/pinctrl-tegra.c
index 51684c5dda34..62a19c6eda3a 100644
--- a/drivers/pinctrl/tegra/pinctrl-tegra.c
+++ b/drivers/pinctrl/tegra/pinctrl-tegra.c
@@ -903,6 +903,8 @@ int tegra_pinctrl_probe(struct platform_device *pdev,
 		backup_regs_size += resource_size(res);
 	}
 	pmx->nbanks = i;
+	if (!pmx->nbanks)
+		return -ENODEV;
 
 	pmx->regs = devm_kzalloc_objs(&pdev->dev, *pmx->regs, pmx->nbanks);
 	if (!pmx->regs)
-- 
2.56.1.911.g883d8bcb20-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 06/12] pinctrl: imx: Serialise MMIO register updates with a spinlock
  2026-12-02  9:29 [PATCH 00/12] pinctrl: Fix Critical and High issues reported by Sashiko (batch 3) Lee Jones
                   ` (4 preceding siblings ...)
  2026-12-02  9:29 ` [PATCH 05/12] pinctrl: tegra: Require at least one register bank in tegra_pinctrl_probe() Lee Jones
@ 2026-12-02  9:30 ` Lee Jones
  2026-12-02 17:22   ` Frank Li
  2026-12-02  9:30 ` [PATCH 07/12] pinctrl: nuvoton: ma35: Avoid double free of shared pin configs Lee Jones
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Lee Jones @ 2026-12-02  9:30 UTC (permalink / raw)
  To: lee, Dong Aisheng, Fabio Estevam, Frank Li, Jacky Bai,
	Pengutronix Kernel Team, NXP S32 Linux Team, Linus Walleij,
	Sascha Hauer, Mehmet Fide, Bartosz Golaszewski, Haibo Chen,
	Takashi Sakamoto, Danilo Krummrich, Bjorn Helgaas,
	Uwe Kleine-König (The Capable Hub), Shawn Guo, linux-gpio,
	imx, linux-arm-kernel, linux-kernel
  Cc: stable

The pinctrl core does not serialise .set_mux() and .pin_config_set()
callbacks against one another or against concurrent .set_mux() calls.
On i.MX platforms that share mux and configuration registers via
SHARE_MUX_CONF_REG or share general-purpose select-input registers,
concurrent read-modify-write sequences in imx_pmx_set_one_pin_mmio(),
imx_pinconf_set_mmio(), and the GPIO direction callbacks can race and
overwrite each other's updates.

Add a raw_spinlock_t to struct imx_pinctrl and hold it across MMIO
read-modify-write register updates.

Fixes: 94176faf279b ("pinctrl: imx: work around select input quirk")
Closes: https://sashiko.dev/#/bug/linux-ccaf34b8-b920-49e6-a8b2-363ee2e9785b
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/pinctrl/freescale/pinctrl-imx.c     | 10 ++++++++++
 drivers/pinctrl/freescale/pinctrl-imx.h     |  2 ++
 drivers/pinctrl/freescale/pinctrl-imx7ulp.c |  3 +++
 drivers/pinctrl/freescale/pinctrl-imx8ulp.c |  3 +++
 drivers/pinctrl/freescale/pinctrl-vf610.c   |  3 +++
 5 files changed, 21 insertions(+)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index b1114dce3485..807f72b8b6ab 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -168,6 +168,7 @@ static int imx_pmx_set_one_pin_mmio(struct imx_pinctrl *ipctl,
 	const struct imx_pinctrl_soc_info *info = ipctl->info;
 	struct imx_pin_mmio *pin_mmio = &pin->conf.mmio;
 	const struct imx_pin_reg *pin_reg;
+	unsigned long flags;
 	unsigned int pin_id;
 
 	pin_id = pin->pin;
@@ -182,10 +183,12 @@ static int imx_pmx_set_one_pin_mmio(struct imx_pinctrl *ipctl,
 	if (info->flags & SHARE_MUX_CONF_REG) {
 		u32 reg;
 
+		raw_spin_lock_irqsave(&ipctl->lock, flags);
 		reg = readl(ipctl->base + pin_reg->mux_reg);
 		reg &= ~info->mux_mask;
 		reg |= (pin_mmio->mux_mode << info->mux_shift);
 		writel(reg, ipctl->base + pin_reg->mux_reg);
+		raw_spin_unlock_irqrestore(&ipctl->lock, flags);
 		dev_dbg(ipctl->dev, "write: offset 0x%x val 0x%x\n",
 			pin_reg->mux_reg, reg);
 	} else {
@@ -217,10 +220,12 @@ static int imx_pmx_set_one_pin_mmio(struct imx_pinctrl *ipctl,
 		 * The input_reg[i] here is actually some IOMUXC general
 		 * purpose register, not regular select input register.
 		 */
+		raw_spin_lock_irqsave(&ipctl->lock, flags);
 		val = readl(ipctl->base + pin_mmio->input_reg);
 		val &= ~mask;
 		val |= select << shift;
 		writel(val, ipctl->base + pin_mmio->input_reg);
+		raw_spin_unlock_irqrestore(&ipctl->lock, flags);
 	} else if (pin_mmio->input_reg) {
 		/*
 		 * Regular select input register can never be at offset
@@ -390,11 +395,15 @@ static int imx_pinconf_set_mmio(struct pinctrl_dev *pctldev,
 
 	for (i = 0; i < num_configs; i++) {
 		if (info->flags & SHARE_MUX_CONF_REG) {
+			unsigned long flags;
 			u32 reg;
+
+			raw_spin_lock_irqsave(&ipctl->lock, flags);
 			reg = readl(ipctl->base + pin_reg->conf_reg);
 			reg &= info->mux_mask;
 			reg |= configs[i];
 			writel(reg, ipctl->base + pin_reg->conf_reg);
+			raw_spin_unlock_irqrestore(&ipctl->lock, flags);
 			dev_dbg(ipctl->dev, "write: offset 0x%x val 0x%x\n",
 				pin_reg->conf_reg, reg);
 		} else {
@@ -840,6 +849,7 @@ int imx_pinctrl_probe(struct platform_device *pdev,
 	imx_pmx_ops.gpio_set_direction = info->gpio_set_direction;
 
 	mutex_init(&ipctl->mutex);
+	raw_spin_lock_init(&ipctl->lock);
 
 	ipctl->info = info;
 	ipctl->dev = &pdev->dev;
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h
index 8fa7e1e2521d..0d33584fa710 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.h
+++ b/drivers/pinctrl/freescale/pinctrl-imx.h
@@ -12,6 +12,7 @@
 #define __DRIVERS_PINCTRL_IMX_H
 
 #include <linux/pinctrl/pinmux.h>
+#include <linux/spinlock.h>
 
 struct platform_device;
 
@@ -79,6 +80,7 @@ struct imx_pinctrl {
 	struct imx_pin_reg *pin_regs;
 	unsigned int group_index;
 	struct mutex mutex;
+	raw_spinlock_t lock;
 };
 
 struct imx_pinctrl_soc_info {
diff --git a/drivers/pinctrl/freescale/pinctrl-imx7ulp.c b/drivers/pinctrl/freescale/pinctrl-imx7ulp.c
index 063805daee03..b44bbc77ab4a 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx7ulp.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx7ulp.c
@@ -263,18 +263,21 @@ static int imx7ulp_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
 {
 	struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
 	const struct imx_pin_reg *pin_reg;
+	unsigned long flags;
 	u32 reg;
 
 	pin_reg = &ipctl->pin_regs[offset];
 	if (pin_reg->mux_reg == -1)
 		return -EINVAL;
 
+	raw_spin_lock_irqsave(&ipctl->lock, flags);
 	reg = readl(ipctl->base + pin_reg->mux_reg);
 	if (input)
 		reg = (reg & ~BM_OBE_ENABLED) | BM_IBE_ENABLED;
 	else
 		reg = (reg & ~BM_IBE_ENABLED) | BM_OBE_ENABLED;
 	writel(reg, ipctl->base + pin_reg->mux_reg);
+	raw_spin_unlock_irqrestore(&ipctl->lock, flags);
 
 	return 0;
 }
diff --git a/drivers/pinctrl/freescale/pinctrl-imx8ulp.c b/drivers/pinctrl/freescale/pinctrl-imx8ulp.c
index 88af25b0d48e..a869de92aeba 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx8ulp.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx8ulp.c
@@ -222,18 +222,21 @@ static int imx8ulp_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
 {
 	struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
 	const struct imx_pin_reg *pin_reg;
+	unsigned long flags;
 	u32 reg;
 
 	pin_reg = &ipctl->pin_regs[offset];
 	if (pin_reg->mux_reg == -1)
 		return -EINVAL;
 
+	raw_spin_lock_irqsave(&ipctl->lock, flags);
 	reg = readl(ipctl->base + pin_reg->mux_reg);
 	if (input)
 		reg = (reg & ~BM_OBE_ENABLED) | BM_IBE_ENABLED;
 	else
 		reg = (reg & ~BM_IBE_ENABLED) | BM_OBE_ENABLED;
 	writel(reg, ipctl->base + pin_reg->mux_reg);
+	raw_spin_unlock_irqrestore(&ipctl->lock, flags);
 
 	return 0;
 }
diff --git a/drivers/pinctrl/freescale/pinctrl-vf610.c b/drivers/pinctrl/freescale/pinctrl-vf610.c
index 77d077618782..930e414ca8d7 100644
--- a/drivers/pinctrl/freescale/pinctrl-vf610.c
+++ b/drivers/pinctrl/freescale/pinctrl-vf610.c
@@ -295,6 +295,7 @@ static int vf610_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
 {
 	struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
 	const struct imx_pin_reg *pin_reg;
+	unsigned long flags;
 	u32 reg;
 
 	pin_reg = &ipctl->pin_regs[offset];
@@ -302,12 +303,14 @@ static int vf610_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
 		return -EINVAL;
 
 	/* IBE always enabled allows us to read the value "on the wire" */
+	raw_spin_lock_irqsave(&ipctl->lock, flags);
 	reg = readl(ipctl->base + pin_reg->mux_reg);
 	if (input)
 		reg &= ~0x2;
 	else
 		reg |= 0x2;
 	writel(reg, ipctl->base + pin_reg->mux_reg);
+	raw_spin_unlock_irqrestore(&ipctl->lock, flags);
 
 	return 0;
 }
-- 
2.56.1.911.g883d8bcb20-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 07/12] pinctrl: nuvoton: ma35: Avoid double free of shared pin configs
  2026-12-02  9:29 [PATCH 00/12] pinctrl: Fix Critical and High issues reported by Sashiko (batch 3) Lee Jones
                   ` (5 preceding siblings ...)
  2026-12-02  9:30 ` [PATCH 06/12] pinctrl: imx: Serialise MMIO register updates with a spinlock Lee Jones
@ 2026-12-02  9:30 ` Lee Jones
  2026-12-02  9:30 ` [PATCH 08/12] pinctrl: keembay: Check src before calling keembay_find_free_slot() Lee Jones
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 22+ messages in thread
From: Lee Jones @ 2026-12-02  9:30 UTC (permalink / raw)
  To: lee, Jacky Huang, Shan-Chun Hung, Linus Walleij, linux-arm-kernel,
	linux-gpio, linux-kernel
  Cc: stable

ma35_pinctrl_parse_groups() allocates a single configs array via
pinconf_generic_parse_dt_config() and assigns the same pointer to every
pin in the group.  ma35_pinctrl_dt_node_to_map_func() then copies that
shared pointer into every PIN_MAP_TYPE_CONFIGS_PIN map entry.  Because
ma35_pctrl_ops uses pinconf_generic_dt_free_map(), tearing down the
pinctrl mapping frees the same configs pointer once per pin, causing an
immediate double free and leaving dangling pointers in the group data
for subsequent mappings.  The configs array is also leaked on error
paths in ma35_pinctrl_parse_groups().

Manage the lifetime of the shared configs array with a devm action
registered right after pinconf_generic_parse_dt_config(), and use a
dedicated dt_free_map callback that frees only the map array.

Fixes: f805e356313b ("pinctrl: nuvoton: Add ma35d1 pinctrl and GPIO driver")
Closes: https://sashiko.dev/#/bug/linux-ec1cf664-4937-4cb3-831c-e2c7838a1aae
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/pinctrl/nuvoton/pinctrl-ma35.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/nuvoton/pinctrl-ma35.c b/drivers/pinctrl/nuvoton/pinctrl-ma35.c
index c20350bc1cdb..b9b34b8b84c6 100644
--- a/drivers/pinctrl/nuvoton/pinctrl-ma35.c
+++ b/drivers/pinctrl/nuvoton/pinctrl-ma35.c
@@ -17,6 +17,7 @@
 #include <linux/platform_device.h>
 #include <linux/property.h>
 #include <linux/regmap.h>
+#include <linux/slab.h>
 
 #include <linux/pinctrl/pinconf.h>
 #include <linux/pinctrl/pinctrl.h>
@@ -236,12 +237,18 @@ static int ma35_pinctrl_dt_node_to_map_func(struct pinctrl_dev *pctldev,
 	return 0;
 }
 
+static void ma35_dt_free_map(struct pinctrl_dev *pctldev,
+			     struct pinctrl_map *map, unsigned int num_maps)
+{
+	kfree(map);
+}
+
 static const struct pinctrl_ops ma35_pctrl_ops = {
 	.get_groups_count = ma35_get_groups_count,
 	.get_group_name = ma35_get_group_name,
 	.get_group_pins = ma35_get_group_pins,
 	.dt_node_to_map = ma35_pinctrl_dt_node_to_map_func,
-	.dt_free_map = pinconf_generic_dt_free_map,
+	.dt_free_map = ma35_dt_free_map,
 };
 
 static int ma35_pinmux_get_func_count(struct pinctrl_dev *pctldev)
@@ -1028,6 +1035,11 @@ static const struct pinconf_ops ma35_pinconf_ops = {
 	.is_generic = true,
 };
 
+static void ma35_free_configs(void *data)
+{
+	kfree(data);
+}
+
 static int ma35_pinctrl_parse_groups(struct fwnode_handle *fwnode, struct group_desc *grp,
 				     struct ma35_pinctrl *npctl, u32 index)
 {
@@ -1043,6 +1055,13 @@ static int ma35_pinctrl_parse_groups(struct fwnode_handle *fwnode, struct group_
 	if (ret)
 		return ret;
 
+	if (configs) {
+		ret = devm_add_action_or_reset(npctl->dev, ma35_free_configs,
+					       configs);
+		if (ret)
+			return ret;
+	}
+
 	count = fwnode_property_count_u32(fwnode, "nuvoton,pins");
 	if (!count || count % 3)
 		return -EINVAL;
-- 
2.56.1.911.g883d8bcb20-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 08/12] pinctrl: keembay: Check src before calling keembay_find_free_slot()
  2026-12-02  9:29 [PATCH 00/12] pinctrl: Fix Critical and High issues reported by Sashiko (batch 3) Lee Jones
                   ` (6 preceding siblings ...)
  2026-12-02  9:30 ` [PATCH 07/12] pinctrl: nuvoton: ma35: Avoid double free of shared pin configs Lee Jones
@ 2026-12-02  9:30 ` Lee Jones
  2026-12-02  9:30 ` [PATCH 09/12] pinctrl: ti: iodelay: Protect generic group addition with pctldev->mutex Lee Jones
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 22+ messages in thread
From: Lee Jones @ 2026-12-02  9:30 UTC (permalink / raw)
  To: lee, Linus Walleij, Husaini Zulkifli, Vijayakannan Ayyathurai,
	Sowjanya D, Vineetha G. Jaya Kumaran, Mark Gross, linux-gpio,
	linux-kernel
  Cc: stable

keembay_gpio_irq_enable() passes the return value of
keembay_find_free_src() straight into keembay_find_free_slot() before
checking whether src is negative.  When all interrupt sources are busy,
keembay_find_free_src() returns -EBUSY, which is implicitly converted to
a large unsigned int in keembay_find_free_slot() and causes an
out-of-bounds MMIO read.

Return early when src is negative before calling
keembay_find_free_slot().

Fixes: ffd4e739358b ("pinctrl: Add Intel Keem Bay pinctrl driver")
Closes: https://sashiko.dev/#/bug/linux-fa91d78e-0d29-4c89-ac5c-9e6a3af3096b
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/pinctrl/pinctrl-keembay.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-keembay.c b/drivers/pinctrl/pinctrl-keembay.c
index cf2a81c3c2cc..78f02693b4fa 100644
--- a/drivers/pinctrl/pinctrl-keembay.c
+++ b/drivers/pinctrl/pinctrl-keembay.c
@@ -1375,9 +1375,11 @@ static void keembay_gpio_irq_enable(struct irq_data *data)
 
 	/* Check which Interrupt source and slot is available */
 	src = keembay_find_free_src(kpc, trig);
+	if (src < 0)
+		return;
+
 	slot = keembay_find_free_slot(kpc, src);
-
-	if (src < 0 || slot < 0)
+	if (slot < 0)
 		return;
 
 	gpiochip_enable_irq(gc, pin);
-- 
2.56.1.911.g883d8bcb20-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 09/12] pinctrl: ti: iodelay: Protect generic group addition with pctldev->mutex
  2026-12-02  9:29 [PATCH 00/12] pinctrl: Fix Critical and High issues reported by Sashiko (batch 3) Lee Jones
                   ` (7 preceding siblings ...)
  2026-12-02  9:30 ` [PATCH 08/12] pinctrl: keembay: Check src before calling keembay_find_free_slot() Lee Jones
@ 2026-12-02  9:30 ` Lee Jones
  2026-12-02  9:30 ` [PATCH 10/12] pinctrl: sunxi: Serialise per-bank regulator request and free Lee Jones
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 22+ messages in thread
From: Lee Jones @ 2026-12-02  9:30 UTC (permalink / raw)
  To: lee, Linus Walleij, Lokesh Vutla, Rob Herring, Nishanth Menon,
	Tony Lindgren, linux-gpio, linux-kernel
  Cc: stable

ti_iodelay_dt_node_to_map() calls pinctrl_generic_add_group() and
pinctrl_generic_get_group() without holding iod->pctl->mutex.  Both
helpers expect the caller to hold pctldev->mutex to serialise radix
tree mutations against concurrent consumer probes and pinctrl core
debugfs readers.

Acquire iod->pctl->mutex around pinctrl_generic_add_group() and the
subsequent pinctrl_generic_get_group() deduplication check.

Fixes: 003910ebc83b ("pinctrl: Introduce TI IOdelay configuration driver")
Closes: https://sashiko.dev/#/bug/linux-3aaee4c1-6bf8-47f0-b590-fb336372c247
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
index 4a48cebbf2b3..f52d0af0794d 100644
--- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
+++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
@@ -13,6 +13,7 @@
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/property.h>
@@ -550,9 +551,12 @@ static int ti_iodelay_dt_node_to_map(struct pinctrl_dev *pctldev,
 	g->ncfg = i;
 	g->config = PIN_CONFIG_END;
 
+	mutex_lock(&iod->pctl->mutex);
 	error = pinctrl_generic_add_group(iod->pctl, np->name, pins, i, g);
-	if (error < 0)
+	if (error < 0) {
+		mutex_unlock(&iod->pctl->mutex);
 		goto free_data;
+	}
 
 	/*
 	 * The core deduplicates groups by name and keeps the first for the
@@ -566,6 +570,7 @@ static int ti_iodelay_dt_node_to_map(struct pinctrl_dev *pctldev,
 		devm_kfree(iod->dev, g);
 		g = grp->data;
 	}
+	mutex_unlock(&iod->pctl->mutex);
 
 	(*map)->type = PIN_MAP_TYPE_CONFIGS_GROUP;
 	(*map)->data.configs.group_or_pin = np->name;
-- 
2.56.1.911.g883d8bcb20-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 10/12] pinctrl: sunxi: Serialise per-bank regulator request and free
  2026-12-02  9:29 [PATCH 00/12] pinctrl: Fix Critical and High issues reported by Sashiko (batch 3) Lee Jones
                   ` (8 preceding siblings ...)
  2026-12-02  9:30 ` [PATCH 09/12] pinctrl: ti: iodelay: Protect generic group addition with pctldev->mutex Lee Jones
@ 2026-12-02  9:30 ` Lee Jones
  2026-12-02  9:30 ` [PATCH 11/12] pinctrl: stm32: Protect irqmux restore with hwspinlock during resume Lee Jones
  2026-12-02  9:30 ` [PATCH 12/12] pinctrl: sx150x: Register threaded IRQ after adding GPIO chip Lee Jones
  11 siblings, 0 replies; 22+ messages in thread
From: Lee Jones @ 2026-12-02  9:30 UTC (permalink / raw)
  To: lee, Linus Walleij, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Andre Przywara, Maxime Ripard, linux-gpio, linux-arm-kernel,
	linux-sunxi, linux-kernel
  Cc: stable

The pinmux core invokes pmxops->request() and pmxops->free() without
holding a controller-wide lock.  When two pins in the same 32-pin bank
are requested or freed concurrently, sunxi_pmx_request() and
sunxi_pmx_free() race on s_reg->regulator and s_reg->refcount, which can
result in duplicate regulator_get()/regulator_enable() calls or
addition-on-zero refcount warnings.

Serialise per-bank regulator acquisition and release in
sunxi_pmx_request() and sunxi_pmx_free() with a mutex.

Fixes: 9a2a566adb00 ("pinctrl: sunxi: Deal with per-bank regulators")
Closes: https://sashiko.dev/#/bug/linux-8e59d9d1-607f-4eba-a596-fa524b707d0e
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/pinctrl/sunxi/pinctrl-sunxi.c | 17 ++++++++++-------
 drivers/pinctrl/sunxi/pinctrl-sunxi.h |  3 +++
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index bf4ec4665e2b..d20415b885a9 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -10,6 +10,7 @@
  * warranty of any kind, whether express or implied.
  */
 
+#include <linux/cleanup.h>
 #include <linux/clk.h>
 #include <linux/export.h>
 #include <linux/gpio/driver.h>
@@ -913,13 +914,16 @@ static int sunxi_pmx_request(struct pinctrl_dev *pctldev, unsigned offset)
 	unsigned short bank_offset = bank - pctl->desc->pin_base /
 					    PINS_PER_BANK;
 	struct sunxi_pinctrl_regulator *s_reg = &pctl->regulators[bank_offset];
-	struct regulator *reg = s_reg->regulator;
+	struct regulator *reg;
 	char supply[16];
 	int ret;
 
 	if (WARN_ON_ONCE(bank_offset >= ARRAY_SIZE(pctl->regulators)))
 		return -EINVAL;
 
+	guard(mutex)(&pctl->reg_lock);
+
+	reg = s_reg->regulator;
 	if (reg) {
 		refcount_inc(&s_reg->refcount);
 		return 0;
@@ -936,7 +940,8 @@ static int sunxi_pmx_request(struct pinctrl_dev *pctldev, unsigned offset)
 	if (ret) {
 		dev_err(pctl->dev,
 			"Couldn't enable bank P%c regulator\n", 'A' + bank);
-		goto out;
+		regulator_put(reg);
+		return ret;
 	}
 
 	sunxi_pinctrl_set_io_bias_cfg(pctl, offset, reg);
@@ -945,11 +950,6 @@ static int sunxi_pmx_request(struct pinctrl_dev *pctldev, unsigned offset)
 	refcount_set(&s_reg->refcount, 1);
 
 	return 0;
-
-out:
-	regulator_put(reg);
-
-	return ret;
 }
 
 static int sunxi_pmx_free(struct pinctrl_dev *pctldev, unsigned offset)
@@ -960,6 +960,8 @@ static int sunxi_pmx_free(struct pinctrl_dev *pctldev, unsigned offset)
 					    PINS_PER_BANK;
 	struct sunxi_pinctrl_regulator *s_reg = &pctl->regulators[bank_offset];
 
+	guard(mutex)(&pctl->reg_lock);
+
 	if (!refcount_dec_and_test(&s_reg->refcount))
 		return 0;
 
@@ -1609,6 +1611,7 @@ int sunxi_pinctrl_init_with_flags(struct platform_device *pdev,
 	platform_set_drvdata(pdev, pctl);
 
 	raw_spin_lock_init(&pctl->lock);
+	mutex_init(&pctl->reg_lock);
 
 	pctl->membase = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(pctl->membase))
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.h b/drivers/pinctrl/sunxi/pinctrl-sunxi.h
index 7c2f29e75519..1d8547e9492e 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.h
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.h
@@ -14,6 +14,7 @@
 #define __PINCTRL_SUNXI_H
 
 #include <linux/kernel.h>
+#include <linux/mutex.h>
 #include <linux/spinlock.h>
 
 #define PA_BASE	0
@@ -187,6 +188,8 @@ struct sunxi_pinctrl {
 	int				*irq;
 	unsigned			*irq_array;
 	raw_spinlock_t			lock;
+	/* Protects @regulators */
+	struct mutex			reg_lock;
 	/*
 	 * Output latch shadow, one word per bank.  Seeded lockless at
 	 * probe before the pinctrl device registers, protected by @lock
-- 
2.56.1.911.g883d8bcb20-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 11/12] pinctrl: stm32: Protect irqmux restore with hwspinlock during resume
  2026-12-02  9:29 [PATCH 00/12] pinctrl: Fix Critical and High issues reported by Sashiko (batch 3) Lee Jones
                   ` (9 preceding siblings ...)
  2026-12-02  9:30 ` [PATCH 10/12] pinctrl: sunxi: Serialise per-bank regulator request and free Lee Jones
@ 2026-12-02  9:30 ` Lee Jones
  2026-12-02 15:28   ` Antonio Borneo
  2026-12-02  9:30 ` [PATCH 12/12] pinctrl: sx150x: Register threaded IRQ after adding GPIO chip Lee Jones
  11 siblings, 1 reply; 22+ messages in thread
From: Lee Jones @ 2026-12-02  9:30 UTC (permalink / raw)
  To: lee, Antonio Borneo, Linus Walleij, Maxime Coquelin,
	Alexandre Torgue, Ju Nan, linux-gpio, linux-stm32,
	linux-arm-kernel, linux-kernel
  Cc: stable

Four IRQ lines share each 32-bit EXTI mux register in SYSCFG, and on
heterogeneous multi-core SoCs (such as STM32MP1) those registers are
shared with a remote coprocessor.  While stm32_gpio_domain_alloc()
serialises regmap_field_write(pctl->irqmux[...]) with both
pctl->irqmux_lock and pctl->hwlock, stm32_pinctrl_restore_gpio_regs()
updates pctl->irqmux[offset] during resume without acquiring either
lock, risking a read-modify-write race with the coprocessor.

Acquire pctl->irqmux_lock and pctl->hwlock around the irqmux register
restore in stm32_pinctrl_restore_gpio_regs().

Fixes: e2f3cf18c3e2 ("pinctrl: stm32: add suspend/resume management")
Closes: https://sashiko.dev/#/bug/linux-f428a25e-342d-4e81-bdba-0948cff6c22d
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/pinctrl/stm32/pinctrl-stm32.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index 01c8a646d9a0..897da5fafaf4 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -2094,9 +2094,27 @@ static int __maybe_unused stm32_pinctrl_restore_gpio_regs(
 			return ret;
 	}
 
-	if (pin_is_irq)
+	if (pin_is_irq) {
+		unsigned long flags;
+
+		spin_lock_irqsave(&pctl->irqmux_lock, flags);
+		if (pctl->hwlock) {
+			ret = hwspin_lock_timeout_in_atomic(pctl->hwlock,
+							    HWSPNLCK_TIMEOUT_MS);
+			if (ret) {
+				dev_err(pctl->dev, "Can't get hwspinlock\n");
+				spin_unlock_irqrestore(&pctl->irqmux_lock, flags);
+				return ret;
+			}
+		}
+
 		regmap_field_write(pctl->irqmux[offset], bank->bank_ioport_nr);
 
+		if (pctl->hwlock)
+			hwspin_unlock_in_atomic(pctl->hwlock);
+		spin_unlock_irqrestore(&pctl->irqmux_lock, flags);
+	}
+
 	return 0;
 }
 
-- 
2.56.1.911.g883d8bcb20-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 12/12] pinctrl: sx150x: Register threaded IRQ after adding GPIO chip
  2026-12-02  9:29 [PATCH 00/12] pinctrl: Fix Critical and High issues reported by Sashiko (batch 3) Lee Jones
                   ` (10 preceding siblings ...)
  2026-12-02  9:30 ` [PATCH 11/12] pinctrl: stm32: Protect irqmux restore with hwspinlock during resume Lee Jones
@ 2026-12-02  9:30 ` Lee Jones
  2026-12-02  9:35   ` Neil Armstrong
  11 siblings, 1 reply; 22+ messages in thread
From: Lee Jones @ 2026-12-02  9:30 UTC (permalink / raw)
  To: lee, Linus Walleij, Uwe Kleine-König (The Capable Hub),
	Neil Armstrong, Gregory Bean, linux-gpio, linux-kernel
  Cc: stable

sx150x_probe() calls devm_request_threaded_irq() with IRQF_SHARED before
devm_gpiochip_add_data().  If a shared or pending interrupt fires before
the GPIO chip is registered, sx150x_irq_thread_fn() passes a NULL
pctl->gpio.irq.domain to irq_find_mapping().  Because devres tears down
resources in LIFO order, this ordering also removes the GPIO chip and
its IRQ domain while the threaded IRQ handler is still active during
probe failure or device unbind, causing a use-after-free.

Move devm_request_threaded_irq() after devm_gpiochip_add_data() so the
IRQ domain is created before the handler can run and torn down after the
IRQ is freed.

Fixes: 0a04d767af8c ("pinctrl: sx150x: Use irqchip template")
Closes: https://sashiko.dev/#/bug/linux-a189ae4f-4985-46ad-acce-6092c69d60e0
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/pinctrl/pinctrl-sx150x.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-sx150x.c b/drivers/pinctrl/pinctrl-sx150x.c
index 0cf68fe22f89..bbc8c4f1f44a 100644
--- a/drivers/pinctrl/pinctrl-sx150x.c
+++ b/drivers/pinctrl/pinctrl-sx150x.c
@@ -1164,7 +1164,7 @@ static int sx150x_probe(struct i2c_client *client)
 				     I2C_FUNC_SMBUS_WRITE_WORD_DATA;
 	struct device *dev = &client->dev;
 	struct sx150x_pinctrl *pctl;
-	u32 irq_type;
+	u32 irq_type = 0;
 	int ret;
 
 	if (!i2c_check_functionality(client->adapter, i2c_funcs))
@@ -1288,7 +1288,13 @@ static int sx150x_probe(struct i2c_client *client)
 					"unsupported irq trigger type %x\n",
 					irq_type);
 		}
+	}
 
+	ret = devm_gpiochip_add_data(dev, &pctl->gpio, pctl);
+	if (ret)
+		return ret;
+
+	if (client->irq > 0) {
 		ret = devm_request_threaded_irq(dev, client->irq, NULL,
 						sx150x_irq_thread_fn,
 						IRQF_ONESHOT | IRQF_SHARED |
@@ -1298,10 +1304,6 @@ static int sx150x_probe(struct i2c_client *client)
 			return ret;
 	}
 
-	ret = devm_gpiochip_add_data(dev, &pctl->gpio, pctl);
-	if (ret)
-		return ret;
-
 	/*
 	 * Pin control functions need to be enabled AFTER registering the
 	 * GPIO chip because sx150x_pinconf_set() calls
-- 
2.56.1.911.g883d8bcb20-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 12/12] pinctrl: sx150x: Register threaded IRQ after adding GPIO chip
  2026-12-02  9:30 ` [PATCH 12/12] pinctrl: sx150x: Register threaded IRQ after adding GPIO chip Lee Jones
@ 2026-12-02  9:35   ` Neil Armstrong
  0 siblings, 0 replies; 22+ messages in thread
From: Neil Armstrong @ 2026-12-02  9:35 UTC (permalink / raw)
  To: Lee Jones, Linus Walleij, Uwe Kleine-König (The Capable Hub),
	Gregory Bean, linux-gpio, linux-kernel
  Cc: stable

On 12/2/26 10:30, Lee Jones wrote:
> sx150x_probe() calls devm_request_threaded_irq() with IRQF_SHARED before
> devm_gpiochip_add_data().  If a shared or pending interrupt fires before
> the GPIO chip is registered, sx150x_irq_thread_fn() passes a NULL
> pctl->gpio.irq.domain to irq_find_mapping().  Because devres tears down
> resources in LIFO order, this ordering also removes the GPIO chip and
> its IRQ domain while the threaded IRQ handler is still active during
> probe failure or device unbind, causing a use-after-free.
> 
> Move devm_request_threaded_irq() after devm_gpiochip_add_data() so the
> IRQ domain is created before the handler can run and torn down after the
> IRQ is freed.
> 
> Fixes: 0a04d767af8c ("pinctrl: sx150x: Use irqchip template")
> Closes: https://sashiko.dev/#/bug/linux-a189ae4f-4985-46ad-acce-6092c69d60e0
> Cc: stable@vger.kernel.org
> Signed-off-by: Lee Jones <lee@kernel.org>
> ---
>   drivers/pinctrl/pinctrl-sx150x.c | 12 +++++++-----
>   1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-sx150x.c b/drivers/pinctrl/pinctrl-sx150x.c
> index 0cf68fe22f89..bbc8c4f1f44a 100644
> --- a/drivers/pinctrl/pinctrl-sx150x.c
> +++ b/drivers/pinctrl/pinctrl-sx150x.c
> @@ -1164,7 +1164,7 @@ static int sx150x_probe(struct i2c_client *client)
>   				     I2C_FUNC_SMBUS_WRITE_WORD_DATA;
>   	struct device *dev = &client->dev;
>   	struct sx150x_pinctrl *pctl;
> -	u32 irq_type;
> +	u32 irq_type = 0;
>   	int ret;
>   
>   	if (!i2c_check_functionality(client->adapter, i2c_funcs))
> @@ -1288,7 +1288,13 @@ static int sx150x_probe(struct i2c_client *client)
>   					"unsupported irq trigger type %x\n",
>   					irq_type);
>   		}
> +	}
>   
> +	ret = devm_gpiochip_add_data(dev, &pctl->gpio, pctl);
> +	if (ret)
> +		return ret;
> +
> +	if (client->irq > 0) {
>   		ret = devm_request_threaded_irq(dev, client->irq, NULL,
>   						sx150x_irq_thread_fn,
>   						IRQF_ONESHOT | IRQF_SHARED |
> @@ -1298,10 +1304,6 @@ static int sx150x_probe(struct i2c_client *client)
>   			return ret;
>   	}
>   
> -	ret = devm_gpiochip_add_data(dev, &pctl->gpio, pctl);
> -	if (ret)
> -		return ret;
> -
>   	/*
>   	 * Pin control functions need to be enabled AFTER registering the
>   	 * GPIO chip because sx150x_pinconf_set() calls

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 02/12] pinctrl: imx: Validate pin_id in imx_pinctrl_parse_pin_mmio()
  2026-12-02  9:29 ` [PATCH 02/12] pinctrl: imx: Validate pin_id in imx_pinctrl_parse_pin_mmio() Lee Jones
@ 2026-12-02  9:50   ` sashiko-bot
  2026-12-02 17:17   ` Frank Li
  1 sibling, 0 replies; 22+ messages in thread
From: sashiko-bot @ 2026-12-02  9:50 UTC (permalink / raw)
  To: Lee Jones, linux-gpio, imx; +Cc: Frank.Li

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] pinctrl: imx: unhandled errors in imx_pinctrl_probe_dt() [1]
--

commit 6b0819d145656fd0c5efa904a33b1bacd1462e80
Author: Lee Jones <lee@kernel.org>

pinctrl: imx: Validate pin_id in imx_pinctrl_parse_pin_mmio()

This commit bounds-checks the derived pin_id against info->npins in
imx_pinctrl_parse_pin_mmio() and propagates -EINVAL to
imx_pinctrl_parse_groups().

> diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
> index ebcce9aeac8c3..0a825f58448f9 100644
> --- a/drivers/pinctrl/freescale/pinctrl-imx.c
> +++ b/drivers/pinctrl/freescale/pinctrl-imx.c

[ ... ]

> @@ -611,10 +621,16 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
>  
>  	for (i = 0; i < grp->grp.npins; i++) {
>  		pin = &((struct imx_pin *)(grp->data))[i];
> -		if (info->flags & IMX_USE_SCU)
> +		if (info->flags & IMX_USE_SCU) {
>  			info->imx_pinctrl_parse_pin(ipctl, &pins[i], pin, &list);
> -		else
> -			imx_pinctrl_parse_pin_mmio(ipctl, &pins[i], pin, &list, np);
> +		} else {
> +			int ret;
> +
> +			ret = imx_pinctrl_parse_pin_mmio(ipctl, &pins[i], pin,
> +							 &list, np);
> +			if (ret)
> +				return ret;
> +		}
>  	}
>  
>  	return 0;

[Severity: High]
This problem wasn't introduced by this patch, but can returning an error
from imx_pinctrl_parse_groups() leave a partially initialized group
registered in pin_group_tree [1]?

imx_pinctrl_parse_functions() inserts grp into pctl->pin_group_tree and
then calls imx_pinctrl_parse_groups() without checking its return value,
and imx_pinctrl_probe_dt() likewise ignores the return value of
imx_pinctrl_parse_functions():

drivers/pinctrl/freescale/pinctrl-imx.c:imx_pinctrl_parse_functions() {
	...
		radix_tree_insert(&pctl->pin_group_tree,
				  ipctl->group_index++, grp);
		mutex_unlock(&ipctl->mutex);

		imx_pinctrl_parse_groups(child, grp, ipctl, i++);
	}
}

If imx_pinctrl_parse_groups() fails before allocating grp->data or
grp->grp.pins (or if a later pin entry fails after only part of the group
is populated), probing still succeeds and later group activation such as
imx_pmx_set() can dereference a NULL or unpopulated pin array.

[1] https://sashiko.dev/#/bug/linux-70c60bc4-5868-4c94-b1bb-7073f7a3316c

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1796203691.git.lee@kernel.org?part=2

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 03/12] pinctrl: single: Protect group and function updates with pctldev->mutex
  2026-12-02  9:29 ` [PATCH 03/12] pinctrl: single: Protect group and function updates with pctldev->mutex Lee Jones
@ 2026-12-02 14:08   ` Bartosz Golaszewski
  0 siblings, 0 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2026-12-02 14:08 UTC (permalink / raw)
  To: Lee Jones
  Cc: Tony Lindgren, Haojian Zhuang, Linus Walleij, Andy Shevchenko,
	linux-arm-kernel, linux-omap, linux-gpio, linux-kernel, stable

On Wed, Dec 02, 2026 at 09:29:57AM +0000, Lee Jones wrote:
> pcs_parse_one_pinctrl_entry() and pcs_parse_bits_in_pinctrl_entry()
> mutate pcs->pctl->pin_function_tree and pcs->pctl->pin_group_tree via
> pcs_add_function(), pinctrl_generic_add_group(), and their removal
> helpers while holding only the driver-private pcs->mutex.  However, the
> pinctrl core debugfs readers and teardown paths traverse and modify
> those radix trees under pctldev->mutex, leaving concurrent readers and
> writers racing without a shared lock.
> 
> Acquire pcs->pctl->mutex instead of pcs->mutex in both parsing
> functions so all generic group and function tree operations are
> serialised against the pinctrl core.
> 
> Fixes: a4ab10860723 ("pinctrl: single: Fix group and function selector use")
> Closes: https://sashiko.dev/#/bug/linux-e32b7426-4575-4354-a2fe-409cde3480ce
> Cc: stable@vger.kernel.org
> Signed-off-by: Lee Jones <lee@kernel.org>
> ---

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 11/12] pinctrl: stm32: Protect irqmux restore with hwspinlock during resume
  2026-12-02  9:30 ` [PATCH 11/12] pinctrl: stm32: Protect irqmux restore with hwspinlock during resume Lee Jones
@ 2026-12-02 15:28   ` Antonio Borneo
  0 siblings, 0 replies; 22+ messages in thread
From: Antonio Borneo @ 2026-12-02 15:28 UTC (permalink / raw)
  To: Lee Jones, Linus Walleij, Maxime Coquelin, Alexandre Torgue,
	Ju Nan, linux-gpio, linux-stm32, linux-arm-kernel, linux-kernel
  Cc: stable

On Wed, 2026-12-02 at 09:30 +0000, Lee Jones wrote:
> Four IRQ lines share each 32-bit EXTI mux register in SYSCFG, and on
> heterogeneous multi-core SoCs (such as STM32MP1) those registers are
> shared with a remote coprocessor.  While stm32_gpio_domain_alloc()
> serialises regmap_field_write(pctl->irqmux[...]) with both
> pctl->irqmux_lock and pctl->hwlock, stm32_pinctrl_restore_gpio_regs()
> updates pctl->irqmux[offset] during resume without acquiring either
> lock, risking a read-modify-write race with the coprocessor.
> 
> Acquire pctl->irqmux_lock and pctl->hwlock around the irqmux register
> restore in stm32_pinctrl_restore_gpio_regs().
> 
> Fixes: e2f3cf18c3e2 ("pinctrl: stm32: add suspend/resume management")
> Closes: https://sashiko.dev/#/bug/linux-f428a25e-342d-4e81-bdba-0948cff6c22d
> Cc: stable@vger.kernel.org
> Signed-off-by: Lee Jones <lee@kernel.org>
> ---
>  drivers/pinctrl/stm32/pinctrl-stm32.c | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
> index 01c8a646d9a0..897da5fafaf4 100644
> --- a/drivers/pinctrl/stm32/pinctrl-stm32.c
> +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
> @@ -2094,9 +2094,27 @@ static int __maybe_unused stm32_pinctrl_restore_gpio_regs(
>                         return ret;
>         }
>  
> -       if (pin_is_irq)
> +       if (pin_is_irq) {
> +               unsigned long flags;
> +
> +               spin_lock_irqsave(&pctl->irqmux_lock, flags);
> +               if (pctl->hwlock) {
> +                       ret = hwspin_lock_timeout_in_atomic(pctl->hwlock,
> +                                                           HWSPNLCK_TIMEOUT_MS);
> +                       if (ret) {
> +                               dev_err(pctl->dev, "Can't get hwspinlock\n");
> +                               spin_unlock_irqrestore(&pctl->irqmux_lock, flags);
> +                               return ret;
> +                       }
> +               }
> +
>                 regmap_field_write(pctl->irqmux[offset], bank->bank_ioport_nr);
>  
> +               if (pctl->hwlock)
> +                       hwspin_unlock_in_atomic(pctl->hwlock);
> +               spin_unlock_irqrestore(&pctl->irqmux_lock, flags);
> +       }
> +
>         return 0;
>  }
>  

Reviewed-by: Antonio Borneo <antonio.borneo@foss.st.com>

Thanks,
Antonio

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 01/12] pinctrl: stm32: Validate npins against STM32_GPIO_PINS_PER_BANK
  2026-12-02  9:29 ` [PATCH 01/12] pinctrl: stm32: Validate npins against STM32_GPIO_PINS_PER_BANK Lee Jones
@ 2026-12-02 16:13   ` Antonio Borneo
  0 siblings, 0 replies; 22+ messages in thread
From: Antonio Borneo @ 2026-12-02 16:13 UTC (permalink / raw)
  To: Lee Jones, Linus Walleij, Maxime Coquelin, Alexandre Torgue,
	Ju Nan, Fabien Dessenne, linux-gpio, linux-stm32,
	linux-arm-kernel, linux-kernel
  Cc: stable

On Wed, 2026-12-02 at 09:29 +0000, Lee Jones wrote:
> stm32_gpiolib_register_bank() computes npins from the device tree
> "gpio-ranges" property as args.args[0] + args.args[2] without checking
> that the resulting value fits within STM32_GPIO_PINS_PER_BANK (16).
> Because bank->pin_backup[] is a fixed-size array of
> STM32_GPIO_PINS_PER_BANK elements and the hardware registers only have
> 16 lines per bank, a larger npins value leads to out-of-bounds array
> accesses and shift overflows.
> 
> Validate that npins is within 1..STM32_GPIO_PINS_PER_BANK.
> 
> Fixes: b67210cc217f ("pinctrl: stm32: consider the GPIO offset to expose all the GPIO lines")
> Closes: https://sashiko.dev/#/bug/linux-efdf6da1-70b0-4c56-add9-2bc97a4c140d
> Cc: stable@vger.kernel.org
> Signed-off-by: Lee Jones <lee@kernel.org>
> ---
>  drivers/pinctrl/stm32/pinctrl-stm32.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
> index bf16e5814bf8..01c8a646d9a0 100644
> --- a/drivers/pinctrl/stm32/pinctrl-stm32.c
> +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
> @@ -1657,13 +1657,26 @@ static int stm32_gpiolib_register_bank(struct stm32_pinctrl *pctl, struct fwnode
>                 bank->gpio_chip.base = args.args[1];
>  
>                 /* get the last defined gpio line (offset + nb of pins) */
> +               if (args.args[0] >= STM32_GPIO_PINS_PER_BANK ||
> +                   args.args[2] > STM32_GPIO_PINS_PER_BANK - args.args[0]) {
> +                       fwnode_handle_put(args.fwnode);
> +                       return -EINVAL;
> +               }
>                 npins = args.args[0] + args.args[2];
>                 fwnode_handle_put(args.fwnode);
>  
>                 while (!fwnode_property_get_reference_args(fwnode, "gpio-ranges", NULL, 3, ++i, &args)) {
> +                       if (args.args[0] >= STM32_GPIO_PINS_PER_BANK ||
> +                           args.args[2] > STM32_GPIO_PINS_PER_BANK - args.args[0]) {
> +                               fwnode_handle_put(args.fwnode);
> +                               return -EINVAL;
> +                       }
>                         npins = max(npins, (int)(args.args[0] + args.args[2]));
>                         fwnode_handle_put(args.fwnode);
>                 }
> +
> +               if (!npins)
> +                       return -EINVAL;
>         } else {
>                 bank_nr = pctl->nbanks;
>                 bank->gpio_chip.base = bank_nr * STM32_GPIO_PINS_PER_BANK;

Hi Lee,

I agree, this change fixes the case of incorrect values for the DT property
"gpio-ranges", values not checked by 'make dtbs_check'.

I thought we should trust the DT as correct, avoiding too many checks in the drivers.
Is there any news I have missed?
Or is this a special case, as it involves a potential out-of-bounds array access?

Anyway,
Reviewed-by: Antonio Borneo <antonio.borneo@foss.st.com>

Thanks,
Antonio

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 02/12] pinctrl: imx: Validate pin_id in imx_pinctrl_parse_pin_mmio()
  2026-12-02  9:29 ` [PATCH 02/12] pinctrl: imx: Validate pin_id in imx_pinctrl_parse_pin_mmio() Lee Jones
  2026-12-02  9:50   ` sashiko-bot
@ 2026-12-02 17:17   ` Frank Li
  1 sibling, 0 replies; 22+ messages in thread
From: Frank Li @ 2026-12-02 17:17 UTC (permalink / raw)
  To: Lee Jones
  Cc: Dong Aisheng, Fabio Estevam, Frank Li, Jacky Bai,
	Pengutronix Kernel Team, NXP S32 Linux Team, Linus Walleij,
	Sascha Hauer, Mehmet Fide, Shawn Guo, linux-gpio, imx,
	linux-arm-kernel, linux-kernel, stable

On Wed, Dec 02, 2026 at 09:29:56AM +0000, Lee Jones wrote:
> imx_pinctrl_parse_pin_mmio() derives *pin_id from mux_reg / 4 or
> conf_reg / 4 and uses it directly to index ipctl->pin_regs[*pin_id] and
> info->pins[*pin_id] without bounds checking against info->npins.  If a
> device tree entry specifies an out-of-range register offset or sets both
> mux_reg and conf_reg to 0 on a SoC without ZERO_OFFSET_VALID (making
> conf_reg == -1 and *pin_id == 0x3fffffff), this results in an
> out-of-bounds memory access.
>
> Validate that *pin_id is less than info->npins and return -EINVAL on
> invalid entries.
>
> Fixes: e16415313c9b ("pinctrl: imx: move hard-coding data into device tree")
> Closes: https://sashiko.dev/#/bug/linux-b67db85c-1fa1-4c97-9932-88c575b568f2
> Cc: stable@vger.kernel.org
> Signed-off-by: Lee Jones <lee@kernel.org>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/pinctrl/freescale/pinctrl-imx.c | 32 ++++++++++++++++++-------
>  1 file changed, 24 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
> index ebcce9aeac8c..0a825f58448f 100644
> --- a/drivers/pinctrl/freescale/pinctrl-imx.c
> +++ b/drivers/pinctrl/freescale/pinctrl-imx.c
> @@ -502,15 +502,16 @@ static const struct pinconf_ops imx_pinconf_ops = {
>  #define FSL_PIN_SHARE_SIZE 20
>  #define FSL_SCU_PIN_SIZE 12
>
> -static void imx_pinctrl_parse_pin_mmio(struct imx_pinctrl *ipctl,
> -				       unsigned int *pin_id, struct imx_pin *pin,
> -				       const __be32 **list_p,
> -				       struct device_node *np)
> +static int imx_pinctrl_parse_pin_mmio(struct imx_pinctrl *ipctl,
> +				      unsigned int *pin_id, struct imx_pin *pin,
> +				      const __be32 **list_p,
> +				      struct device_node *np)
>  {
>  	const struct imx_pinctrl_soc_info *info = ipctl->info;
>  	struct imx_pin_mmio *pin_mmio = &pin->conf.mmio;
>  	struct imx_pin_reg *pin_reg;
>  	const __be32 *list = *list_p;
> +	unsigned int id;
>  	u32 mux_reg, conf_reg;
>  	u32 config;
>
> @@ -527,7 +528,14 @@ static void imx_pinctrl_parse_pin_mmio(struct imx_pinctrl *ipctl,
>  			conf_reg = -1;
>  	}
>
> -	*pin_id = (mux_reg != -1) ? mux_reg / 4 : conf_reg / 4;
> +	id = (mux_reg != -1) ? mux_reg / 4 : conf_reg / 4;
> +	if (id >= info->npins) {
> +		dev_err(ipctl->dev, "Invalid pin id %u in node %pOF\n",
> +			id, np);
> +		return -EINVAL;
> +	}
> +
> +	*pin_id = id;
>  	pin_reg = &ipctl->pin_regs[*pin_id];
>  	pin->pin = *pin_id;
>  	pin_reg->mux_reg = mux_reg;
> @@ -547,6 +555,8 @@ static void imx_pinctrl_parse_pin_mmio(struct imx_pinctrl *ipctl,
>
>  	dev_dbg(ipctl->dev, "%s: 0x%x 0x%08lx", info->pins[*pin_id].name,
>  			     pin_mmio->mux_mode, pin_mmio->config);
> +
> +	return 0;
>  }
>
>  static int imx_pinctrl_parse_groups(struct device_node *np,
> @@ -611,10 +621,16 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
>
>  	for (i = 0; i < grp->grp.npins; i++) {
>  		pin = &((struct imx_pin *)(grp->data))[i];
> -		if (info->flags & IMX_USE_SCU)
> +		if (info->flags & IMX_USE_SCU) {
>  			info->imx_pinctrl_parse_pin(ipctl, &pins[i], pin, &list);
> -		else
> -			imx_pinctrl_parse_pin_mmio(ipctl, &pins[i], pin, &list, np);
> +		} else {
> +			int ret;
> +
> +			ret = imx_pinctrl_parse_pin_mmio(ipctl, &pins[i], pin,
> +							 &list, np);
> +			if (ret)
> +				return ret;
> +		}
>  	}
>
>  	return 0;
> --
> 2.56.1.911.g883d8bcb20-goog
>
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 04/12] pinctrl: imx: Propagate DT parsing errors in imx_pinctrl_probe_dt()
  2026-12-02  9:29 ` [PATCH 04/12] pinctrl: imx: Propagate DT parsing errors in imx_pinctrl_probe_dt() Lee Jones
@ 2026-12-02 17:20   ` Frank Li
  0 siblings, 0 replies; 22+ messages in thread
From: Frank Li @ 2026-12-02 17:20 UTC (permalink / raw)
  To: Lee Jones
  Cc: Dong Aisheng, Fabio Estevam, Frank Li, Jacky Bai,
	Pengutronix Kernel Team, NXP S32 Linux Team, Linus Walleij,
	Sascha Hauer, Mehmet Fide, Gary Bisson, linux-gpio, imx,
	linux-arm-kernel, linux-kernel, stable

On Wed, Dec 02, 2026 at 09:29:58AM +0000, Lee Jones wrote:
> imx_pinctrl_parse_functions() inserts each group descriptor into
> pctl->pin_group_tree before calling imx_pinctrl_parse_groups() and
> ignores the return value of imx_pinctrl_parse_groups().  Likewise,
> imx_pinctrl_probe_dt() ignores the return value of
> imx_pinctrl_parse_functions().  If a device tree group node is malformed
> or a memory allocation fails, partially initialised group descriptors
> with NULL data pointers remain registered in the radix tree and cause a
> NULL pointer dereference when the pinctrl core or debugfs accesses the
> group.
>
> Parse each group before inserting it into pctl->pin_group_tree and
> propagate errors from imx_pinctrl_parse_groups() and
> imx_pinctrl_parse_functions().  Return 0 when a function node has no
> groups so boards with empty controller nodes continue to probe as
> before.
>
> Fixes: e566fc11ea76 ("pinctrl: imx: use generic pinctrl helpers for managing groups")
> Closes: https://sashiko.dev/#/bug/linux-70c60bc4-5868-4c94-b1bb-7073f7a3316c
> Cc: stable@vger.kernel.org
> Signed-off-by: Lee Jones <lee@kernel.org>
> ---
>  drivers/pinctrl/freescale/pinctrl-imx.c | 22 ++++++++++++++--------
>  1 file changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
> index 0a825f58448f..b1114dce3485 100644
> --- a/drivers/pinctrl/freescale/pinctrl-imx.c
> +++ b/drivers/pinctrl/freescale/pinctrl-imx.c
> @@ -658,7 +658,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
>  	func->ngroups = of_get_child_count(np);
>  	if (func->ngroups == 0) {
>  		dev_info(ipctl->dev, "no groups defined in %pOF\n", np);
> -		return -EINVAL;
> +		return 0;

I think it is correct to allow empty groups, but need seperate patch for
it.

>  	}
>
>  	group_names = devm_kzalloc_objs(ipctl->dev, *group_names, func->ngroups);
> @@ -679,6 +679,10 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
>  		if (!grp)
>  			return -ENOMEM;
>
> +		ret = imx_pinctrl_parse_groups(child, grp, ipctl, i++);
> +		if (ret)
> +			return ret;
> +
>  		mutex_lock(&ipctl->mutex);
>  		/*
>  		 * FIXME: This should use pinctrl_generic_add_group() and not
> @@ -687,8 +691,6 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
>  		radix_tree_insert(&pctl->pin_group_tree,
>  				  ipctl->group_index++, grp);
>  		mutex_unlock(&ipctl->mutex);
> -
> -		imx_pinctrl_parse_groups(child, grp, ipctl, i++);
>  	}
>
>  	return 0;
> @@ -718,7 +720,6 @@ static int imx_pinctrl_probe_dt(struct platform_device *pdev,
>  				struct imx_pinctrl *ipctl)
>  {
>  	struct device_node *np = pdev->dev.of_node;
> -	struct device_node *child;
>  	struct pinctrl_dev *pctl = ipctl->pctl;
>  	u32 nfuncs = 0;
>  	u32 i = 0;
> @@ -743,16 +744,21 @@ static int imx_pinctrl_probe_dt(struct platform_device *pdev,
>  		pctl->num_groups = of_get_child_count(np);
>  	} else {
>  		pctl->num_groups = 0;
> -		for_each_child_of_node(np, child)
> +		for_each_child_of_node_scoped(np, child)

This one fix difference problem, need seperate patch to fix it

Frank

>  			pctl->num_groups += of_get_child_count(child);
>  	}
>
>  	if (flat_funcs) {
> -		imx_pinctrl_parse_functions(np, ipctl, 0);
> +		return imx_pinctrl_parse_functions(np, ipctl, 0);
>  	} else {
> +		int ret;
> +
>  		i = 0;
> -		for_each_child_of_node(np, child)
> -			imx_pinctrl_parse_functions(child, ipctl, i++);
> +		for_each_child_of_node_scoped(np, child) {
> +			ret = imx_pinctrl_parse_functions(child, ipctl, i++);
> +			if (ret)
> +				return ret;
> +		}
>  	}
>
>  	return 0;
> --
> 2.56.1.911.g883d8bcb20-goog
>
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 06/12] pinctrl: imx: Serialise MMIO register updates with a spinlock
  2026-12-02  9:30 ` [PATCH 06/12] pinctrl: imx: Serialise MMIO register updates with a spinlock Lee Jones
@ 2026-12-02 17:22   ` Frank Li
  2026-12-02 20:08     ` Lee Jones
  0 siblings, 1 reply; 22+ messages in thread
From: Frank Li @ 2026-12-02 17:22 UTC (permalink / raw)
  To: Lee Jones
  Cc: Dong Aisheng, Fabio Estevam, Frank Li, Jacky Bai,
	Pengutronix Kernel Team, NXP S32 Linux Team, Linus Walleij,
	Sascha Hauer, Mehmet Fide, Bartosz Golaszewski, Haibo Chen,
	Takashi Sakamoto, Danilo Krummrich, Bjorn Helgaas,
	Uwe Kleine-König (The Capable Hub), Shawn Guo, linux-gpio,
	imx, linux-arm-kernel, linux-kernel, stable

On Wed, Dec 02, 2026 at 09:30:00AM +0000, Lee Jones wrote:
> The pinctrl core does not serialise .set_mux() and .pin_config_set()
> callbacks against one another or against concurrent .set_mux() calls.
> On i.MX platforms that share mux and configuration registers via
> SHARE_MUX_CONF_REG or share general-purpose select-input registers,
> concurrent read-modify-write sequences in imx_pmx_set_one_pin_mmio(),
> imx_pinconf_set_mmio(), and the GPIO direction callbacks can race and
> overwrite each other's updates.
>
> Add a raw_spinlock_t to struct imx_pinctrl and hold it across MMIO

why choose raw_spinlock_t instead of spinlock_t?

Frank

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 06/12] pinctrl: imx: Serialise MMIO register updates with a spinlock
  2026-12-02 17:22   ` Frank Li
@ 2026-12-02 20:08     ` Lee Jones
  0 siblings, 0 replies; 22+ messages in thread
From: Lee Jones @ 2026-12-02 20:08 UTC (permalink / raw)
  To: Frank Li
  Cc: Dong Aisheng, Fabio Estevam, Frank Li, Jacky Bai,
	Pengutronix Kernel Team, NXP S32 Linux Team, Linus Walleij,
	Sascha Hauer, Mehmet Fide, Bartosz Golaszewski, Haibo Chen,
	Takashi Sakamoto, Danilo Krummrich, Bjorn Helgaas,
	Uwe Kleine-König (The Capable Hub), Shawn Guo, linux-gpio,
	imx, linux-arm-kernel, linux-kernel, stable

> On Wed, Dec 02, 2026 at 09:30:00AM +0000, Lee Jones wrote:
> > The pinctrl core does not serialise .set_mux() and .pin_config_set()
> > callbacks against one another or against concurrent .set_mux() calls.
> > On i.MX platforms that share mux and configuration registers via
> > SHARE_MUX_CONF_REG or share general-purpose select-input registers,
> > concurrent read-modify-write sequences in imx_pmx_set_one_pin_mmio(),
> > imx_pinconf_set_mmio(), and the GPIO direction callbacks can race and
> > overwrite each other's updates.
> >
> > Add a raw_spinlock_t to struct imx_pinctrl and hold it across MMIO
> 
> why choose raw_spinlock_t instead of spinlock_t?

Thanks for the interest and the question, Frank.

A regular 'spinlock_t' becomes a sleeping rt_mutex under PREEMPT_RT.

Whilst standard pinctrl state transitions like pinctrl_select_state()
occur in process context, the '.gpio_set_direction' callback is also
wired into the pinctrl ops and shares this lock.

Moreover, pinctrl state switches can be invoked from low-level PM and
idle paths where sleeping is not allowed and 'raw_spinlock_t' is the
standard choice across pinctrl drivers for short MMIO register
read-modify-write.

If someone can confirm that none of the i.MX call paths can ever be
reached from atomic or non-sleepable contexts (even under PREEMPT_RT),
we could downgrade this to 'spinlock_t', otherwise 'raw_spinlock_t' is
the safer option for a few-instruction MMIO critical section.

-- 
Lee Jones

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2026-12-02 20:08 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02  9:29 [PATCH 00/12] pinctrl: Fix Critical and High issues reported by Sashiko (batch 3) Lee Jones
2026-12-02  9:29 ` [PATCH 01/12] pinctrl: stm32: Validate npins against STM32_GPIO_PINS_PER_BANK Lee Jones
2026-12-02 16:13   ` Antonio Borneo
2026-12-02  9:29 ` [PATCH 02/12] pinctrl: imx: Validate pin_id in imx_pinctrl_parse_pin_mmio() Lee Jones
2026-12-02  9:50   ` sashiko-bot
2026-12-02 17:17   ` Frank Li
2026-12-02  9:29 ` [PATCH 03/12] pinctrl: single: Protect group and function updates with pctldev->mutex Lee Jones
2026-12-02 14:08   ` Bartosz Golaszewski
2026-12-02  9:29 ` [PATCH 04/12] pinctrl: imx: Propagate DT parsing errors in imx_pinctrl_probe_dt() Lee Jones
2026-12-02 17:20   ` Frank Li
2026-12-02  9:29 ` [PATCH 05/12] pinctrl: tegra: Require at least one register bank in tegra_pinctrl_probe() Lee Jones
2026-12-02  9:30 ` [PATCH 06/12] pinctrl: imx: Serialise MMIO register updates with a spinlock Lee Jones
2026-12-02 17:22   ` Frank Li
2026-12-02 20:08     ` Lee Jones
2026-12-02  9:30 ` [PATCH 07/12] pinctrl: nuvoton: ma35: Avoid double free of shared pin configs Lee Jones
2026-12-02  9:30 ` [PATCH 08/12] pinctrl: keembay: Check src before calling keembay_find_free_slot() Lee Jones
2026-12-02  9:30 ` [PATCH 09/12] pinctrl: ti: iodelay: Protect generic group addition with pctldev->mutex Lee Jones
2026-12-02  9:30 ` [PATCH 10/12] pinctrl: sunxi: Serialise per-bank regulator request and free Lee Jones
2026-12-02  9:30 ` [PATCH 11/12] pinctrl: stm32: Protect irqmux restore with hwspinlock during resume Lee Jones
2026-12-02 15:28   ` Antonio Borneo
2026-12-02  9:30 ` [PATCH 12/12] pinctrl: sx150x: Register threaded IRQ after adding GPIO chip Lee Jones
2026-12-02  9:35   ` Neil Armstrong

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.