🇰🇷 한글 설명
Linux 커널의 airoha NPU 드라이버에서 워치독(WDT) 인터럽트 해제 전 작업 취소가 제대로 이루어지지 않아 발생하는 문제입니다. 인터럽트가 해제되기 전에 워크 아이템이 다시 스케줄링될 수 있으며, 이로 인해 이미 해제된 메모리에 접근하는 Use-After-Free 취약점이 발생합니다.
💡 쉬운 설명
장치가 꺼질 때 하드웨어 신호가 남아 있어, 이미 삭제된 메모리 영역을 시스템이 다시 사용하려고 시도하는 오류입니다. 이로 인해 시스템이 갑자기 멈추거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net: airoha: npu: cancel wdt_work after releasing the WDT IRQ
airoha_npu_remove() calls cancel_work_sync() on each core's wdt_work,
but the watchdog IRQ that queues it is requested with devm_request_irq()
and is freed only after .remove() returns. airoha_npu_wdt_handler() can
therefore schedule_work() again once the cancel has returned. struct
airoha_npu, which contains the work, is devm_kzalloc()'d and is freed in
that same unwind, so the late work dereferences freed memory.
Register the work with devm_work_autocancel() before devm_request_irq()
and drop .remove(). Devres runs in reverse order, so the IRQ is freed
before cancel_work_sync(), including when probe fails. A cancel left in
.remove() cannot get that order. Initializing the work first also stops
a pending watchdog interrupt from queuing an uninitialized work item.
Probe currently calls INIT_WORK() only after devm_request_irq().
This issue was identified during our ongoing static-analysis research
while reviewing kernel code.
📍 영향받는 시스템
Linux kernel (airoha NPU driver 포함 버전)
⚔️ 공격 벡터
로컬 공격자가 특정 하드웨어 인터럽트 타이밍을 조작하여 메모리 오류 유도
🛡️ 대응 방법
커널 패치를 적용하여 devm_work_autocancel()을 사용하고 인터럽트 해제 순서를 올바르게 수정해야 함
🔧 검증 코드
현재 커널 버전과 해당 드라이버 소스 코드의 존재 여부를 확인하여 패치 적용 여부를 판단합니다.
uname -r && grep -r "airoha_npu_wdt_handler" /lib/modules/$(uname -r)/kernel/drivers/net/ 2>/dev/null