🇰🇷 한글 설명
Linux 커널의 jz4780 I2C 드라이버에서 Common Clock Framework(CCF)의 prepare_lock과 I2C 어댑터 락 사이의 AB/BA 데드락 취약점이 발견되었습니다. I2C 클라이언트 클록 생성기가 등록될 때 CCF 락을 획득한 상태에서 I2C 전송을 시도하고, 동시에 다른 I2C 작업이 클록 속도를 확인하려다 CCF 락을 요청하면서 시스템이 멈추는 현상이 발생합니다.
💡 쉬운 설명
컴퓨터의 부품들이 서로의 작업이 끝나기를 기다리며 무한히 대기하는 상태(데드락)가 발생하여 시스템이 완전히 멈출 수 있는 문제입니다. 클록 속도를 매번 확인하는 대신 미리 저장해 두는 방식으로 해결할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
i2c: jz4780: Cache host clock rate at probe to prevent CCF prepare_lock deadlock
Fix a severe AB/BA deadlock between the Common Clock Framework (CCF)
and the I2C adapter lock, which triggers when an I2C-controlled clock
generator client (like the Si5351) is registered or modified under the CCF.
During an i2c client clock (generator) frequency change, the CCF acquires its global
'prepare_lock' mutex and the driver calls i2c_transfer() to update the client's
chip registers, stalling for the adapter's I2C bus lock.
Concurrently, an independent, parallel transfer on the same bus (e.g., a GPIO
expander handling LEDs) can hold the I2C adapter lock. Inside this parallel
transfer path, jz4780_i2c_set_speed() calls clk_get_rate() on the host
controller's input clock to calculate bus timings. This call attempts to acquire
the blocked CCF 'prepare_lock', creating a circular dependency that freezes
the system.
The jz4780 host controller clock itself is static and never changes at runtime.
However, calling clk_get_rate() inside the active transfer path introduces
an unnecessary dependency on the CCF internal locks.
Eliminate this synchronous clk_get_rate() call from the active transfer
path by caching the static host peripheral clock rate once - inside the private
jz4780_i2c structure during jz4780_i2c_probe(). Update jz4780_i2c_set_speed()
to use this cached value, safely decoupling active I2C transactions from the
CCF internal locks without any risk of stale timings.
Assisted-by web based Google AI (pinpointing the bug and writing the message).
📍 영향받는 시스템
Linux kernel (jz4780 I2C driver component)
⚔️ 공격 벡터
로컬 환경에서 특정 I2C 장치(클록 생성기 등)를 등록하거나 조작하여 데드락 유도 가능
🛡️ 대응 방법
커널 패치를 통해 jz4780_i2c_probe 단계에서 클록 속도를 미리 캐싱하도록 업데이트
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 최신 패치 버전인지 확인
💻 영향받는 소프트웨어
NVIDIA Cloud Gaming Guest Driver for Linux