Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH v2 0/6] pinctrl: Fix out-of-bounds accesses, divide-by-zero, and error handling
@ 2026-11-19 20:47 Lee Jones
  2026-11-19 20:47 ` [PATCH v2 2/6] pinctrl: ingenic: Fix element type of x1600_sfc_funcs array Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Lee Jones @ 2026-11-19 20:47 UTC (permalink / raw)
  To: lee, Matthias Brugger, AngeloGioacchino Del Regno, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: Aaron Kling, Andreas Kemnade, Bartosz Golaszewski, Daniel Golle,
	Hao Chang, H. Nikolaus Schaller, Jonathan Hunter, Linus Walleij,
	linux-gpio, linux-mips, linux-tegra, Maoguang Meng,
	Nicolas Boichat, Olivier Louvignes, Paul Boddie, Paul Cercueil,
	Qingliang Li, Rob Herring, Ryder.Lee, Sam Shih, Sean Wang,
	Thierry Reding, Thierry Reding, zhouyanjie

These issues were reported by Sashiko.

v1 => v2:
 - Drop patches 05/10, 06/10, 07/10, and 10/10, already applied to pinctrl
   for-next
 - Drop patch 01/10 (sunxi) in favour of the broader Allwinner IRQ-bank
   rework in flight (Andre, Sashiko)
 - mediatek: Guard against NULL eint in mtk_eint_do_suspend() and
   mtk_eint_do_resume() before resetting hw->eint to NULL on error (Sashiko)

v1: https://lore.kernel.org/all/20261103213002.1673560-1-lee@kernel.org/

Cc: Aaron Kling <webgeek1234@gmail.com>
Cc: Andreas Kemnade <andreas@kemnade.info>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: Bartosz Golaszewski <brgl@kernel.org>
Cc: Daniel Golle <daniel@makrotopia.org>
Cc: Hao Chang <ot_chhao.chang@mediatek.com>
Cc: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Linus Walleij <linusw@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-gpio@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-mips@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: Maoguang Meng <maoguang.meng@mediatek.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Nicolas Boichat <drinkcat@chromium.org>
Cc: Olivier Louvignes <olivier@mgcrea.io>
Cc: Paul Boddie <paul@boddie.org.uk>
Cc: Paul Cercueil <paul@crapouillou.net>
Cc: Qingliang Li <qingliang.li@mediatek.com>
Cc: Rob Herring <robh@kernel.org>
Cc: "Ryder.Lee" <ryder.lee@mediatek.com>
Cc: Sam Shih <sam.shih@mediatek.com>
Cc: Sean Wang <sean.wang@kernel.org>
Cc: Thierry Reding <thierry.reding@kernel.org>
Cc: Thierry Reding <treding@nvidia.com>
Cc: zhouyanjie@wanyeetech.com

Lee Jones (6):
  pinctrl: tegra186: Fix out-of-bounds register bank index for AON drive
    groups
  pinctrl: ingenic: Fix element type of x1600_sfc_funcs array
  pinctrl: mediatek: mt7981: Add missing entries to mt7981_ant_sel_funcs
  pinctrl: mediatek: Guard against NULL eint in mtk_eint_do_suspend()
    and mtk_eint_do_resume()
  pinctrl: mediatek: Clean up partially initialised hw->eint on error
  pinctrl: mediatek: Prevent divide-by-zero for pins with fixed drive
    strength

 drivers/pinctrl/mediatek/mtk-eint.c           |   6 ++
 drivers/pinctrl/mediatek/pinctrl-mt7981.c     |   2 +-
 .../pinctrl/mediatek/pinctrl-mtk-common-v2.c  |  24 ++++-
 drivers/pinctrl/pinctrl-ingenic.c             |   2 +-
 drivers/pinctrl/tegra/pinctrl-tegra186.c      | 102 +++++++++---------
 5 files changed, 79 insertions(+), 57 deletions(-)

-- 
2.56.1.750.gf70dc682cf-goog


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

* [PATCH v2 2/6] pinctrl: ingenic: Fix element type of x1600_sfc_funcs array
  2026-11-19 20:47 [PATCH v2 0/6] pinctrl: Fix out-of-bounds accesses, divide-by-zero, and error handling Lee Jones
@ 2026-11-19 20:47 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2026-11-19 20:47 UTC (permalink / raw)
  To: lee, Paul Cercueil, Linus Walleij, Olivier Louvignes, Paul Boddie,
	zhouyanjie, H. Nikolaus Schaller, Andreas Kemnade, linux-mips,
	linux-gpio, linux-kernel
  Cc: stable

ingenic_pinmux_set_mux() treats grp->data as a u8 array of per-pin mux
modes (u8 *pin_modes = grp->data), and every other *_funcs array in the
Ingenic pinctrl driver is declared as u8[].  Because x1600_sfc_funcs[]
was declared as int[], indexing pin_modes[0..6] reads the first seven
bytes of the int array (0, 0, 0, 0, 0, 0, 0) instead of reading mode 2
for the seventh pin.

Change the element type of x1600_sfc_funcs[] from int to u8.

Fixes: 4da56f9c6f14 ("pinctrl: ingenic: add x1600 support")
Closes: https://sashiko.dev/#/bug/linux-5dccd0ae-9450-440a-87d0-44cc86d1af45
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---

v1 => v2: No changes

 drivers/pinctrl/pinctrl-ingenic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c
index 4d27ec03f15f..d39bb901aaca 100644
--- a/drivers/pinctrl/pinctrl-ingenic.c
+++ b/drivers/pinctrl/pinctrl-ingenic.c
@@ -2470,7 +2470,7 @@ static int x1600_mac_pins[] = {
 	0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c,
 };
 
-static int x1600_sfc_funcs[] = { 0, 0, 0, 0, 0, 0, 2, };
+static u8 x1600_sfc_funcs[] = { 0, 0, 0, 0, 0, 0, 2, };
 
 static const struct group_desc x1600_groups[] = {
 	INGENIC_PIN_GROUP("uart0-data", x1600_uart0_data, 0),
-- 
2.56.1.750.gf70dc682cf-goog


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

end of thread, other threads:[~2026-11-19 20:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 20:47 [PATCH v2 0/6] pinctrl: Fix out-of-bounds accesses, divide-by-zero, and error handling Lee Jones
2026-11-19 20:47 ` [PATCH v2 2/6] pinctrl: ingenic: Fix element type of x1600_sfc_funcs array Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox