🇰🇷 한글 설명
Linux 커널 USB ChipIdea UDC 드라이버의 _ep_nuke() 함수가 DMA 버퍼 언매핑과 산재-수집 바운스 버퍼 정리를 제대로 수행하지 못해 발생합니다. USB 장치 재연결 시 이전 DMA 상태가 남아 메모리 손상으로 이어질 수 있습니다.
💡 쉬운 설명
USB 기기를 여러 번 연결했다 뺐다 할 때 일부 Linux 커널에서 메모리 정리 실패로 시스템이 불안정해질 수 있습니다. 최신 커널 업데이트로 해결됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: chipidea: udc: fix DMA and SG cleanup in _ep_nuke()
The ChipIdea UDC driver can encounter "not page aligned sg buffer"
errors when a USB device is reconnected after being disconnected
during an active transfer. This occurs because _ep_nuke() returns
requests to the gadget layer without properly unmapping DMA buffers
or cleaning up scatter-gather bounce buffers.
Root cause:
When a disconnect happens during a multi-segment DMA transfer, the
request's num_mapped_sgs field and sgt.sgl pointer remain set with
stale values. The request is returned to the gadget driver with status
-ESHUTDOWN but still has active DMA state. If the gadget driver reuses
this request on reconnect without reinitializing it, the stale DMA
state causes _hardware_enqueue() to skip DMA mapping (seeing non-zero
num_mapped_sgs) and attempt to use freed/invalid DMA addresses,
leading to alignment errors and potential memory corruption.
The normal completion path via _hardware_dequeue() properly calls
usb_gadget_unmap_request_by_dev() and sglist_do_debounce() before
returning the request. The _ep_nuke() path must do the same cleanup
to ensure requests are returned in a clean, reusable state.
Fix:
Add DMA unmapping and bounce buffer cleanup to _ep_nuke() to mirror
the cleanup sequence in _hardware_dequeue():
- Call usb_gadget_unmap_request_by_dev() if num_mapped_sgs is set
- Call sglist_do_debounce() with copy=false if bounce buffer exists
This ensures that when requests are returned due to endpoint shutdown,
they don't retain stale DMA mappings. The 'false' parameter to
sglist_do_debounce() prevents copying data back (appropriate for
shutdown path where transfer was aborted).
📍 영향받는 시스템
Linux 커널 USB ChipIdea UDC 드라이버 (패치 미적용 모든 버전)
⚔️ 공격 벡터
로컬 공격자가 USB 포트에 물리적으로 접근하여 장치의 반복적 연결/해제로 메모리 손상 유발 가능
🛡️ 대응 방법
Linux 커널을 최신 버전으로 업그레이드하여 ChipIdea UDC 드라이버 패치 적용
🔧 검증 코드
현재 커널 버전을 확인하고 CVE-2026-43250 패치가 적용된 버전과 비교하여 업그레이드 필요 여부 판단