🇰🇷 한글 설명
Linux 커널의 qcom-cpucp mailbox 드라이버에서 PREEMPT_RT 환경 사용 시 인터럽트 핸들러 내에서 자기 교착 상태(self-deadlock)가 발생하는 취약점입니다. 특정 함수 호출 과정에서 이미 보유한 잠금(lock)을 다시 획득하려 시도하면서 시스템이 영구적으로 멈추는 현상이 발생합니다.
💡 쉬운 설명
컴퓨터의 특정 부품이 신호를 처리하는 과정에서, 자신이 이미 잡고 있는 열쇠를 다시 잡으려고 시도하다가 영원히 멈춰버리는 문제입니다. 이로 인해 시스템이 응답하지 않는 상태가 될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mailbox: qcom-cpucp: fix PREEMPT_RT self-deadlock in IRQ handler
qcom_cpucp_mbox_irq_fn() calls mbox_chan_received_data() while holding
chan->lock. Under PREEMPT_RT, spin_lock_irqsave() is converted to an
rt_spinlock (rtmutex-based), which tracks ownership and can sleep.
The callback chain triggered by mbox_chan_received_data() eventually
reaches mailbox_clear_channel() -> mbox_send_message() -> add_to_rbuf(),
which attempts to re-acquire the same chan->lock. Since rtmutex detects
the re-entrant lock attempt by the same owner, the thread blocks waiting
for a lock it already holds, causing a permanent deadlock.
This deadlock manifests as 'irq/N-apss_cpucp_mbox' stuck in D state
with the following call trace:
rt_spin_lock -> mbox_send_message -> mailbox_clear_channel ->
scmi_rx_callback -> mbox_chan_received_data [<- held chan->lock here]
Fix by saving chan->cl locally and clearing the HW interrupt register
inside the lock, then invoking mbox_chan_received_data() after releasing
the lock. This preserves the mutual exclusion for chan->cl access while
avoiding the lock re-entrancy that causes the PREEMPT_RT deadlock.
📍 영향받는 시스템
PREEMPT_RT 패치가 적용된 Linux 커널 기반의 Qualcomm CPU/CPUP 관련 시스템
⚔️ 공격 벡터
로컬 시스템 환경(PREEMPT_RT 커널 사용 시)에서 특정 하드웨어 인터럽트 발생을 통한 교착 상태 유도
🛡️ 대응 방법
커널 패치를 통해 인터럽트 핸들러 내에서 잠금(lock)을 해제한 후 콜백 함수를 호출하도록 수정된 최신 커널로 업데이트
🔧 검증 코드
출력 결과에 PREEMPT_RT 문구가 포함되어 있다면 해당 취약점이 발생할 수 있는 환경임을 의미합니다.
uname -a | grep -i 'PREEMPT_RT'