🇰🇷 한글 설명
Linux 커널의 USB CDC NCM 드라이버에서 NDP(Network Data Pointer) 헤더의 경계 검사 시 ndpoffset을 누락하여 발생하는 취약점입니다. 공격자가 특수 제작된 USB 네트워크 인터페이스를 통해 out-of-bounds 메모리를 읽을 수 있습니다.
💡 쉬운 설명
USB 네트워크 기기의 데이터 위치 정보를 검증할 때, 시작 위치를 고려하지 않아 버퍼 끝을 넘어 메모리를 읽을 수 있습니다. 악의적인 USB 기기를 연결하면 시스템 메모리가 노출될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net: usb: cdc_ncm: add ndpoffset to NDP16 nframes bounds check
cdc_ncm_rx_verify_ndp16() validates that the NDP header and its DPE
entries fit within the skb. The first check correctly accounts for
ndpoffset:
if ((ndpoffset + sizeof(struct usb_cdc_ncm_ndp16)) > skb_in->len)
but the second check omits it:
if ((sizeof(struct usb_cdc_ncm_ndp16) +
ret * (sizeof(struct usb_cdc_ncm_dpe16))) > skb_in->len)
This validates the DPE array size against the total skb length as if
the NDP were at offset 0, rather than at ndpoffset. When the NDP is
placed near the end of the NTB (large wNdpIndex), the DPE entries can
extend past the skb data buffer even though the check passes.
cdc_ncm_rx_fixup() then reads out-of-bounds memory when iterating
the DPE array.
Add ndpoffset to the nframes bounds check and use struct_size_t() to
express the NDP-plus-DPE-array size more clearly.
📍 영향받는 시스템
Linux 커널 4.14 이상의 cdc_ncm.c 드라이버를 포함한 모든 버전 (일부 배포판은 백포트됨)
⚔️ 공격 벡터
물리적 USB 포트에 악의적인 USB CDC NCM 네트워크 기기를 연결하여 out-of-bounds 메모리 읽기 트리거
🛡️ 대응 방법
Linux 커널을 최신 버전으로 업데이트 또는 ndpoffset 검사를 추가한 패치 적용
🔧 검증 코드
uname -r | grep -E '^(4\.[0-9]+|5\.[0-9]{1,2}|6\.[0-9]{1,2})' && echo 'Potentially vulnerable' || echo 'Check kernel version'