🇰🇷 한글 설명
Linux 커널의 ljca 드라이버에서 ljca_enumerate_gpio() 함수가 bank_num의 범위를 적절히 검증하지 않아 발생하는 스택 버퍼 오버플로 취약점입니다. 악의적인 LJCA 장치가 잘못된 bank_num 값을 보고할 경우, 할당된 배열의 크기를 초과하여 스택 메모리에 데이터를 쓸 수 있습니다.
💡 쉬운 설명
특정 USB 장치가 컴퓨터에 연결될 때, 장치가 보내는 잘못된 정보를 제대로 확인하지 않아 컴퓨터의 중요한 메모리 영역을 망가뜨릴 수 있는 문제입니다. 이를 통해 해커가 컴퓨터의 제어권을 탈취할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: ljca: bound bank_num in ljca_enumerate_gpio()
ljca_enumerate_gpio() reads desc->bank_num from the device and loops
valid_pin[i] = get_unaligned_le32(...) for i < bank_num. valid_pin[]
holds only LJCA_MAX_GPIO_NUM / 32 = 2 entries.
Two checks run before the loop. The reply length must match
struct_size(desc, bank_desc, bank_num). The product
pins_per_bank * bank_num must not exceed LJCA_MAX_GPIO_NUM. Neither one
bounds bank_num against the size of valid_pin[]. The reply is capped at
LJCA_MAX_PAYLOAD_SIZE (60) bytes, so the struct_size check limits
bank_num to 9. A device that reports bank_num 9 with pins_per_bank 7
still passes both checks. gpio_num is 63 and the reply is 56 bytes. The
loop then writes nine u32 into the two entry array and overruns
valid_pin[] on the stack.
A broken or malicious LJCA device can therefore overflow the stack.
Reject a bank_num that does not fit valid_pin[].
📍 영향받는 시스템
Linux kernel (ljca driver 포함 버전)
⚔️ 공격 벡터
취약한 드라이버를 사용하는 시스템에 조작된 데이터를 전송하는 악의적인 LJCA USB 장치를 연결
🛡️ 대응 방법
ljca_enumerate_gpio() 함수 내에서 bank_num이 valid_pin[] 배열 크기를 초과하지 않도록 검증 로직을 추가한 커널 패치 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인