🇰🇷 한글 설명
Linux 커널의 aspeed-vhub USB 가젯 드라이버에서 장치 제거 시 wake_work가 적절히 취소되지 않아 발생하는 Use-After-Free 취약점입니다. 장치가 제거되는 동안 또는 제거 직후에 예약된 작업이 실행되면서 이미 해제된 메모리 영역에 접근할 수 있습니다.
💡 쉬운 설명
컴퓨터에서 USB 장치를 뽑을 때, 시스템이 해당 장치를 위해 준비해둔 작업이 장치가 사라진 뒤에도 실행되려고 시도하여 오류를 일으키는 문제입니다. 이 과정에서 시스템이 불안정해지거나 보안 문제가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: aspeed-vhub: cancel wake work on device removal
wake_work is armed from the gadget .wakeup callback to resume suspended
downstream ports, and it is never cancelled in ast_vhub_remove(), so a
work item queued before or during removal can run after devm has freed
vhub and its ports, a use-after-free.
Cancelling the work alone is not sufficient: usb_gadget_wakeup() takes
no lock and the unbind path never clears wakeup_en, so a remote-wakeup
request in flight on another CPU can re-arm the work after the cancel
and before vhub is freed.
ast_vhub_del_dev() already clears d->registered under vhub->lock before
unregistering the gadget. Refuse the wakeup in ast_vhub_udc_wakeup()
once d->registered is clear: the check and the schedule_work() are then
atomic against the unbind, so a wakeup that passed before the flag was
cleared is drained by the cancel_work_sync() after the del_dev loop,
and one that arrives later returns without arming. Also move INIT_WORK()
to the top of ast_vhub_probe(), since the probe error path reuses
ast_vhub_remove() and would otherwise cancel a never-initialized work
item.
This issue was found by an in-house static analysis tool.
📍 영향받는 시스템
Linux kernel (aspeed-vhub USB gadget driver 포함 버전)
⚔️ 공격 벡터
장치 제거 프로세스 도중 특정 타이밍에 원격 웨이크업(remote-wakeup) 요청을 보내 메모리 오류 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 수정된 패치 버전인지 확인