🇰🇷 한글 설명
Linux 커널의 STM32 CEC 드라이버에서 수신된 데이터의 길이를 확인하지 않고 버퍼에 쓰는 경계 외 쓰기(Out-of-bounds write) 취약점이 발견되었습니다. 원격 CEC 장치가 메시지 종료 신호 없이 지속적으로 데이터를 전송할 경우, 고정된 버퍼 크기를 초과하여 주변 메모리를 덮어쓸 수 있습니다.
💡 쉬운 설명
리눅스 시스템의 특정 하드웨어 제어 기능에서 데이터가 들어올 때 그 양이 적절한지 확인하지 않는 결함이 있습니다. 이를 통해 공격자가 허용된 용량보다 더 많은 데이터를 보내 시스템의 중요한 메모리 영역을 망가뜨릴 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
media: cec: stm32: prevent out-of-bounds write on RX overflow
stm32_rx_done() appends each received CEC byte to rx_msg.msg[] using
rx_msg.len as the write index, incrementing it on every RXBR
(receive-byte-ready) interrupt without checking it against the buffer
size:
cec->rx_msg.msg[cec->rx_msg.len++] = val & 0xFF;
rx_msg.msg[] is a fixed CEC_MAX_MSG_SIZE (16) byte array in struct
cec_msg, and rx_msg.len is only reset on RXACKE/RXOVR or after a
completed message (RXEND). The number of bytes received before RXEND is
decided by the remote CEC device (it sets EOM), not by the driver. A
peer that keeps sending bytes without ending the message drives RXBR
repeatedly, pushing rx_msg.len past 16 and writing peer-controlled bytes
out of bounds into the surrounding memory. This is reachable in normal
operation once the driver has probed and receiving is enabled, from the
IRQ thread, without any local privilege.
The length check in the CEC core runs on the consumer side, after the
byte has been stored, so it does not prevent the overflow. Bound the
index in the driver before the store, as the other platform CEC drivers
already do (e.g. tegra_cec), dropping the excess bytes of an overlong
frame.
Found by static analysis tool CodeQL.
📍 영향받는 시스템
Linux kernel (media: cec: stm32 driver 포함 버전)
⚔️ 공격 벡터
네트워크 또는 연결된 CEC 장치를 통해 종료 신호가 없는 과도한 데이터를 전송하여 발생
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 데이터 수신 시 경계 검사 로직을 적용해야 함
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 패치된 최신 버전인지 확인하십시오.