🇰🇷 한글 설명
Linux 커널의 dwc3 USB 컨트롤러 드라이버에서 발생한 문제로, suspend(절전) 컨텍스트에서 인터럽트가 비활성화된 상태로 sleepable 콜백을 호출하여 Lockdep 오류를 유발합니다. 이 취약점은 dwc3_gadget_suspend() 함수가 락을 보유한 채로 잠들 수 있는 함수를 호출함으로써 발생하며, 이를 해결하기 위해 콜백 실행 시점을 락 해제 이후로 조정하는 패치가 적용되었습니다.
💡 쉬운 설명
컴퓨터가 절전 모드로 들어갈 때 USB 장치 연결을 끊는 과정에서 시스템 규칙을 어기는 동작이 발생했습니다. 이로 인해 시스템이 불안정해지거나 오류가 발생할 수 있어 이를 수정하는 작업이 이루어졌습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: dwc3: run gadget disconnect from sleepable suspend context
dwc3_gadget_suspend() takes dwc->lock with IRQs disabled and then calls
dwc3_disconnect_gadget(). For async callbacks that helper only uses
plain spin_unlock()/spin_lock(), so the gadget ->disconnect() callback
still runs with IRQs disabled and any sleepable callback trips Lockdep.
This issue was found by our static analysis tool and then manually
reviewed against the current tree.
The grounded PoC kept the dwc3_gadget_suspend() ->
dwc3_disconnect_gadget() -> gadget_driver->disconnect() chain, and
Lockdep reported:
BUG: sleeping function called from invalid context
gadget_disconnect+0x21/0x39 [vuln_msv]
dwc3_gadget_suspend.constprop.0+0x2b/0x42 [vuln_msv]
Keep the disconnect callback selection in one common helper, but add a
sleepable suspend-side wrapper which snapshots the callback under
dwc->lock and then runs it after spin_unlock_irqrestore(). The regular
event path still uses the existing spin_unlock()/spin_lock() window.
📍 영향받는 시스템
Linux kernel (dwc3 driver module)
⚔️ 공격 벡터
로컬 시스템에서 특정 USB 가젯 드라이버를 사용하는 환경에서 절전 모드 진입 시 발생 가능
🛡️ 대응 방법
dwc3 드라이버의 suspend 관련 패치가 적용된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인