🇰🇷 한글 설명
Linux 커널의 usb gadget f_ncm 드라이버에서 NTB 헤더의 block_len 값을 검증할 때 하한선이 없어 발생하는 정수 언더플로우 취약점입니다. 공격자가 조작된 block_len을 전달하면 경계 검사가 무력화되어 커널 메모리의 인접 데이터가 네트워크 skb로 복사될 수 있습니다.
💡 쉬운 설명
USB 연결을 통해 들어오는 데이터의 길이를 확인하는 과정에서 계산 오류가 발생하여 보안 검사를 우회할 수 있는 문제입니다. 이를 통해 해커가 컴퓨터 내부의 중요한 정보를 몰래 빼낼 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: f_ncm: validate minimum block_len in ncm_unwrap_ntb()
The block_len read from the host-supplied NTB header is checked against
ntb_max but has no lower bound. When block_len is smaller than
opts->ndp_size, the bounds check of:
ndp_index > (block_len - opts->ndp_size)
will underflow producing a huge unsigned value that ndp_index can never
exceed, defeating the check entirely.
The same underflow occurs in the datagram index checks against block_len
- opts->dpe_size. With those checks neutered, a malicious USB host can
choose ndp_index and datagram offsets that point past the actual
transfer, and the skb_put_data() copies adjacent kernel memory into the
network skb.
Fix this by rejecting block lengths that cannot hold at least the NTB
header plus one NDP. This will make block_len - opts->ndp_size and
block_len - opts->dpe_size both well-defined.
Commit 8d2b1a1ec9f5 ("CDC-NCM: avoid overflow in sanity checking") fixed
a related class of issues on the host side of NCM.
📍 영향받는 시스템
Linux kernel (usb gadget f_ncm driver)
⚔️ 공격 벡터
악의적인 USB 호스트를 통해 조작된 NTB 헤더를 가진 패킷을 전송하여 커널 메모리 유출 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 block_len 하한선 검증 로직 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 커밋(8d2b1a1ec9f5 관련 패치)이 포함된 버전인지 확인