CVE-2026-97501: pinctrl: mediatek: paris: bypass pinctrl GPIO layer in set GPIO direction
In the Linux kernel, the following vulnerability has been resolved:
pinctrl: mediatek: paris: bypass pinctrl GPIO layer in set GPIO direction
pinctrlgpiodirectioninput() / pinctrlgpiodirectionoutput() take the pinctrl mutex. This causes a gpiochip operations to need to sleep. Worse yet, the .cansleep field in the gpiochip is not set. This causes the shared GPIO proxy to trip over, as it uses gpiodcansleep() to check whether it can use a spinlock or needs a mutex. In this case, it ends up taking a spinlock, then calls pinctrlgpiodirectionoutput(), which takes a mutex. This causes a huge warning.
While this class of Mediatek hardware does not have separate clear/set registers, the pinctrl context has a spinlock that is taken whenever a register read-modify-write is done. Also, once the GPIO function is selected / muxed in, further GPIO operations do not involve pinctrl operations or state. The GPIO direction and level values do not require toggling the pinmux or any other pin config options.
Switch to directly calling mtkpinmuxgpiosetdirection() in the GPIO set direction callbacks to avoid taking the pinctrl mutex. Drop the .gpiosetdirection field in mtkpmxops to signal we are no longer using the pinctrl GPIO layer for setting the direction.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Bypass the pinctrl GPIO layer when setting GPIO direction by directly calling mtk_pinmux_gpio_set_direction(); stop using the .gpio_set_direction field in mtk_pmxops.
Linux kernel Mediatek Paris pinctrl GPIO GPIO direction callbacks = directly call mtk_pinmux_gpio_set_direction()
Event History
Frequently Asked Questions
What systems are exposed to this issue?
Systems using the affected MediaTek Paris pinctrl GPIO implementation are exposed when GPIO direction callbacks are invoked. The problem is specifically relevant where GPIO operations are used through the shared GPIO proxy.
What conditions trigger the warning?
The shared GPIO proxy checks gpiod_cansleep() and may take a spinlock because the gpiochip does not advertise that its operations can sleep. A subsequent GPIO direction operation then calls into pinctrl code that takes a mutex, producing a warning from sleeping while under the spinlock.
Is changing pin multiplexing required to set GPIO direction on this hardware?
No. After the GPIO function has been selected or muxed, direction and level changes do not require changing pinmux state or other pin configuration options. The fix directly uses the MediaTek pinmux GPIO direction helper instead of the pinctrl GPIO direction layer.