Thread (29 messages) 29 messages, 5 authors, 2025-08-28
STALE277d REVIEWED: 1 (0M)

[PATCH v5 15/15] pinctrl: qcom: make the pinmuxing strict

From: Bartosz Golaszewski <hidden>
Date: 2025-08-15 09:09:44
Also in: imx, linux-arm-kernel, linux-arm-msm, linux-gpio, linux-hardening, linux-mips, linux-mm, linux-omap, linux-renesas-soc, lkml
Subsystem: arm/qualcomm mailing list, pin control subsystem, pin controller - qualcomm, the rest · Maintainers: Linus Walleij, Bjorn Andersson, Linus Torvalds

From: Bartosz Golaszewski <redacted>

The strict flag in struct pinmux_ops disallows the usage of the same pin
as a GPIO and for another function. Without it, a rouge user-space
process with enough privileges (or even a buggy driver) can request a
used pin as GPIO and drive it, potentially confusing devices or even
crashing the system. Set it globally for all pinctrl-msm users.

Reviewed-by: Konrad Dybcio <redacted>
Signed-off-by: Bartosz Golaszewski <redacted>
---
 drivers/pinctrl/qcom/pinctrl-msm.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index a5f69464827119dfe2a7781b558094b283fca215..1751d838ce95d6138c824b90098f74891dec7656 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -268,6 +268,7 @@ static const struct pinmux_ops msm_pinmux_ops = {
 	.function_is_gpio	= pinmux_generic_function_is_gpio,
 	.gpio_request_enable	= msm_pinmux_request_gpio,
 	.set_mux		= msm_pinmux_set_mux,
+	.strict			= true,
 };
 
 static int msm_config_reg(struct msm_pinctrl *pctrl,
-- 
2.48.1

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help