🇰🇷 한글 설명
Linux 커널 USB gadget f_midi 드라이버에서 MIDI Streaming descriptor의 bNumEmbMIDIJack과 bLength 필드가 잘못 설정되는 취약점입니다. in/out 포트 개수가 다를 경우 호스트가 초기화되지 않은 스택 메모리를 포함한 손상된 descriptor를 수신하여 민감한 정보가 유출됩니다.
💡 쉬운 설명
Linux 기반 USB MIDI 장치에서 포트 설정 정보가 잘못되어 메모리 내용이 노출되는 문제입니다. 입출력 포트 개수가 다를 때만 발생합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: f_midi: fix MIDI Streaming descriptor lengths
While the MIDI jacks are configured correctly, and the MIDIStreaming
endpoint descriptors are filled with the correct information,
bNumEmbMIDIJack and bLength are set incorrectly in these descriptors.
This does not matter when the numbers of in and out ports are equal, but
when they differ the host will receive broken descriptors with
uninitialized stack memory leaking into the descriptor for whichever
value is smaller.
The precise meaning of "in" and "out" in the port counts is not clearly
defined and can be confusing. But elsewhere the driver consistently
uses this to match the USB meaning of IN and OUT viewed from the host,
so that "in" ports send data to the host and "out" ports receive data
from it.
📍 영향받는 시스템
Linux 커널 (USB MIDI gadget 사용) - in/out 포트 개수가 불일치하는 디바이스
⚔️ 공격 벡터
USB MIDI 디바이스 연결 시 자동으로 발생하는 메모리 정보 유출
🛡️ 대응 방법
Linux 커널 패치 적용 (f_midi.c 드라이버 수정 버전으로 업데이트)
🔧 검증 코드
커널 버전 확인 후 f_midi 드라이버 로드 여부 확인, USB MIDI 디바이스 연결 시 dmesg에서 descriptor 오류 메시지 확인
uname -r | grep -E '^[0-9]' && grep -i midi /proc/modules 2>/dev/null || echo 'MIDI not loaded'