🇰🇷 한글 설명
Linux 커널의 CAN bus 드라이버(ems_usb)에서 USB URB 데이터를 파싱할 때 버퍼 크기를 올바르게 검증하지 않아 발생하는 취약점입니다. actual_length(실제 버퍼 크기)와 transfer_buffer_length(최대 크기)를 혼동하여 메시지 경계를 넘어 버퍼 오버플로우가 발생할 수 있습니다.
💡 쉬운 설명
CAN 장치 드라이버가 USB로 받은 데이터의 크기를 제대로 확인하지 않아 메모리 범위를 벗어나 접근할 수 있는 문제입니다. USB 장치를 통해 특수 제작된 데이터를 전송하면 시스템 메모리가 손상될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
can: ems_usb: ems_usb_read_bulk_callback(): check the proper length of a message
When looking at the data in a USB urb, the actual_length is the size of
the buffer passed to the driver, not the transfer_buffer_length which is
set by the driver as the max size of the buffer.
When parsing the messages in ems_usb_read_bulk_callback() properly check
the size both at the beginning of parsing the message to make sure it is
big enough for the expected structure, and at the end of the message to
make sure we don't overflow past the end of the buffer for the next
message.
📍 영향받는 시스템
Linux kernel with ems_usb CAN driver (all unpatched versions)
⚔️ 공격 벡터
USB를 통해 특수 제작된 CAN 메시지를 전송하여 메모리 오버플로우 유발
🛡️ 대응 방법
Linux kernel을 최신 버전으로 업그레이드하여 해당 패치 적용
🔧 검증 코드
결과가 있으면 ems_usb 드라이버 설치 상태이며, 커널 버전으로 패치 적용 여부 확인 필요
find /lib/modules -type f -name '*ems_usb*' 2>/dev/null