🇰🇷 한글 설명
Linux 커널의 MediaTek Paris pinctrl 드라이버에서 GPIO 방향 설정 시 pinctrl 레이어를 우회하지 않아 발생하는 문제입니다. 이로 인해 GPIO 조작 시 잠자기(sleep)가 필요한 뮤텍스를 호출하게 되며, 스핀락을 사용하는 공유 GPIO 프록시와 충돌하여 시스템 경고를 유발할 수 있습니다.
💡 쉬운 설명
기기 내부의 핀 설정을 변경할 때, 시스템이 잠시 멈춰야 하는 동작을 잘못된 방식으로 수행하여 충돌이 발생하는 문제입니다. 이로 인해 시스템에 경고가 뜨거나 예기치 않은 동작이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
pinctrl: mediatek: paris: bypass pinctrl GPIO layer in set GPIO direction
pinctrl_gpio_direction_input() / pinctrl_gpio_direction_output() take
the pinctrl mutex. This causes a gpiochip operations to need to sleep.
Worse yet, the .can_sleep field in the gpiochip is not set. This causes
the shared GPIO proxy to trip over, as it uses gpiod_cansleep() to check
whether it can use a spinlock or needs a mutex. In this case, it ends
up taking a spinlock, then calls pinctrl_gpio_direction_output(), 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 mtk_pinmux_gpio_set_direction() in the GPIO
set direction callbacks to avoid taking the pinctrl mutex. Drop the
.gpio_set_direction field in mtk_pmxops to signal we are no longer using
the pinctrl GPIO layer for setting the direction.
📍 영향받는 시스템
MediaTek Paris 하드웨어를 사용하는 Linux 커널 기반 시스템
⚔️ 공격 벡터
로컬 권한을 가진 공격자가 GPIO 제어 관련 시스템 호출을 통해 커널 경고 및 불안정성을 유발할 수 있음
🛡️ 대응 방법
pinctrl 뮤텍스를 사용하지 않고 직접 mtk_pinmux_gpio_set_direction()을 호출하도록 커널 패치를 적용해야 함
🔧 검증 코드
현재 커널 버전과 MediaTek 관련 드라이버 로드 여부를 확인하여 패치 적용 대상인지 판단합니다.
uname -r && grep -i 'mediatek' /lib/modules/$(uname -r)/modules.dep 2>/dev/null
💻 영향받는 소프트웨어
NVIDIA Cloud Gaming Guest Driver for Linux