🇰🇷 한글 설명
Linux 커널의 pinctrl: spacemit 드라이버에서 spacemit_pin_set_config 함수가 잘못된 변수를 검사하여 발생하는 취약점입니다. 핀 번호 0을 유효하지 않은 값으로 오인하여 특정 핀의 설정이 무시되거나, 잘못된 참조로 인해 NULL 포인터 역참조가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터의 핀 설정을 할 때 0번 핀을 잘못된 번호로 인식하여 설정을 건너뛰거나 오류를 일으키는 문제입니다. 이로 인해 하드웨어의 특정 기능이 제대로 작동하지 않을 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
pinctrl: spacemit: fix NULL check in spacemit_pin_set_config
spacemit_pin_set_config() looks up the per-pin descriptor with
spacemit_get_pin() then checks the wrong variable for failure:
const struct spacemit_pin *spin = spacemit_get_pin(pctrl, pin);
...
if (!pin)
return -EINVAL;
reg = spacemit_pin_to_reg(pctrl, spin->pin);
pin is an unsigned int pin id, where 0 (GPIO_0 / gmac0_rxdv on K3) is a
valid pin, so rejecting it here drops the PAD config write for the first
pin of every group. On K3 Pico-ITX the GMAC RGMII group lists pin 0 as
its first entry, so its drive-strength / bias configuration was silently
ignored.
The intended guard is against spacemit_get_pin() returning NULL when the
pin id isn't in the SoC's pin table. Check spin instead, which both
restores PAD setup for pin 0 and prevents a NULL deref on spin->pin.
📍 영향받는 시스템
Linux kernel (pinctrl: spacemit 드라이버를 사용하는 시스템)
⚔️ 공격 벡터
로컬 공격자가 잘못된 핀 설정을 유도하여 커널 오류를 발생시키거나 하드웨어 설정을 우회할 수 있음
🛡️ 대응 방법
spacemit_pin_set_config 함수 내의 NULL 체크 로직을 pin 대신 spin 변수를 확인하도록 수정된 최신 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 패치가 적용된 최신 버전인지 확인