🇰🇷 한글 설명
Linux 커널의 pca953x GPIO 드라이버에서 발생하는 레이스 컨디션 취약점입니다. irq_bus_sync_unlock() 함수 호출 시 i2c_lock을 적절히 유지하지 않아 인터럽트 래치 및 마스크 설정 과정에서 잘못된 레지스터에 데이터가 기록될 수 있습니다.
💡 쉬운 설명
여러 작업이 동시에 실행될 때 순서가 뒤엉켜 하드웨어 설정값이 잘못 입력되는 문제입니다. 이로 인해 GPIO 장치의 인터럽트 기능이 오작동할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
gpio: pca953x: fix pca953x_irq_bus_sync_unlock race
Ensure that `i2c_lock' is held when setting interrupt latch and mask in
pca953x_irq_bus_sync_unlock() in order to avoid races.
The other (non-probe) call site pca953x_gpio_set_multiple() ensures the
lock is held before calling pca953x_write_regs().
The problem occurred when a request raced against irq_bus_sync_unlock()
approximately once per thousand reboots on an i.MX8MP based system.
* Normal case
0-0022: write register AI|3a {03,02,00,00,01} Input latch P0
0-0022: write register AI|49 {fc,fd,ff,ff,fe} Interrupt mask P0
0-0022: write register AI|08 {ff,00,00,00,00} Output P3
0-0022: write register AI|12 {fc,00,00,00,00} Config P3
* Race case
0-0022: write register AI|08 {ff,00,00,00,00} Output P3
0-0022: write register AI|08 {03,02,00,00,01} *** Wrong register ***
0-0022: write register AI|12 {fc,00,00,00,00} Config P3
0-0022: write register AI|49 {fc,fd,ff,ff,fe} Interrupt mask P0
📍 영향받는 시스템
pca953x 드라이버를 사용하는 Linux 커널 기반 시스템 (예: i.MX8MP 기반 시스템)
⚔️ 공격 벡터
로컬 시스템에서 하드웨어 제어 명령을 동시에 빈번하게 호출하여 레이스 컨디션을 유도
🛡️ 대응 방법
pca953x_irq_bus_sync_unlock() 함수 내에서 i2c_lock을 유지하도록 수정된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 버전인지 확인