]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pinctrl: qcom: make the pinmuxing strict
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 2 Sep 2025 11:59:25 +0000 (13:59 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 8 Sep 2025 12:23:24 +0000 (14:23 +0200)
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 <konrad.dybcio@oss.qualcomm.com>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/qcom/pinctrl-msm.c

index a5f69464827119dfe2a7781b558094b283fca215..1751d838ce95d6138c824b90098f74891dec7656 100644 (file)
@@ -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,