CVE-2026-89725: media: cec: stm32: prevent out-of-bounds write on RX overflow
In the Linux kernel, the following vulnerability has been resolved:
media: cec: stm32: prevent out-of-bounds write on RX overflow
stm32rxdone() appends each received CEC byte to rxmsg.msg[] using rxmsg.len as the write index, incrementing it on every RXBR (receive-byte-ready) interrupt without checking it against the buffer size:
cec->rxmsg.msg[cec->rxmsg.len++] = val & 0xFF;
rxmsg.msg[] is a fixed CECMAXMSGSIZE (16) byte array in struct cecmsg, and rxmsg.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 rxmsg.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. tegracec), dropping the excess bytes of an overlong frame.
Found by static analysis tool CodeQL.
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Systems using the STM32 CEC driver are exposed after the driver has probed and CEC reception is enabled. Exploitation requires a CEC peer capable of sending an unterminated stream of received bytes.
Does exploiting this require local access or elevated privileges?
No. The vulnerable receive path is reachable from the IRQ thread during normal operation, and the description states that no local privilege is required.
What makes the overflow possible?
A remote CEC device controls whether a message is ended through EOM. If it continues sending bytes without ending the message, the driver increments the receive-message length beyond the fixed 16-byte message buffer and writes attacker-controlled byte values out of bounds.
Can the CEC core's length validation prevent the memory corruption?
No. The CEC core checks message length only after the driver has already stored the received byte, so that validation occurs too late to prevent the out-of-bounds write.