Драйвер STM32WBA IEEE 802.15.4 в drivers/ieee802154/ieee802154_stm32wba.c вычислил длину пакета принимаемого кадра как pkt_len rx_frame->length - IEEE802154_FCS_LENGTH без предварительной проверки того, что радиоотчётная длина может содержать FCS. pkt_len является uint8_t, поэтому заявленная длина 0 или 1 обернута в 254 или 255. Единственным ограничением на результирующее значение был __ASSERT_NO_MSG(pkt_len CONFIG_NET_BUF_DATA_SIZE), который не компилируется в конфигурации производства по умолчанию (CONFIG_ASSERT=n). Длина берёт начало в ST (p_metadata->length, хранящийся в stm32wba_802154_receive_done()), и, в конечном счёте, в заголовке PHY кадра, принимаемого по воздуху, поэтому на него влияет любой злоумышленник в пределах радиодиапазона устройства. Достижение недостаточного потока требует, чтобы уровень канала поставщика выходил на поверхность кадра короче, чем FCS без ошибок; драйвер не проводил собственную проверку этого значения.
Когда происходит отток, stm32wba_802154_rx_thread() вызывает net_pkt_write(pkt, rx_frame->psdu, pkt_len) длиной около 254 байт против буфера приема, который содержит не более одного пакета PHY (IEEE802154_MAX_PHY_PACKET_SIZE, 127 байт). Это считывает примерно 128 байтов после конца радиоприемника и копирует эту смежную память в сетевой пакет, который передается в сетевой стек, давая out-of-bounds чтение с потенциальным раскрытием смежного RAM плюс ненужное негабаритное распределение пакетов в потоке RX. Исправление отклоняет кадр, сообщенная длина которого меньше, чем IEEE802154_FCS_LENGTH перед вычитанием, и заменяет скомпилированное утверждение проверкой длины во время выполнения, которая сбрасывает негабаритные кадры, сопоставляя проверку во время выполнения, уже присутствующую в drivers/ieee802154/ieee802154_nrf5.c.
Показать оригинальное описание (EN)
The STM32WBA IEEE 802.15.4 driver in drivers/ieee802154/ieee802154_stm32wba.c computed the packet length of a received frame as pkt_len = rx_frame->length - IEEE802154_FCS_LENGTH without first checking that the radio-reported length could hold an FCS. pkt_len is a uint8_t, so a reported length of 0 or 1 wrapped to 254 or 255. The only bound on the resulting value was __ASSERT_NO_MSG(pkt_len <= CONFIG_NET_BUF_DATA_SIZE), which compiles to nothing in the default production configuration (CONFIG_ASSERT=n). The length originates in the ST link-layer receive-done metadata (p_metadata->length, stored by stm32wba_802154_receive_done()), and ultimately in the PHY header of a frame received over the air, so it is influenced by any attacker within radio range of the device. Reaching the underflow requires the vendor link layer to surface a frame shorter than the FCS with no error; the driver performed no validation of its own on that value. When the underflow occurs, stm32wba_802154_rx_thread() calls net_pkt_write(pkt, rx_frame->psdu, pkt_len) with a length of about 254 bytes against a receive buffer that holds at most one PHY packet (IEEE802154_MAX_PHY_PACKET_SIZE, 127 bytes). This reads roughly 128 bytes past the end of the radio receive buffer and copies that adjacent memory into a network packet that is submitted to the networking stack, giving an out-of-bounds read with a potential disclosure of adjacent RAM plus needless oversized packet allocation in the RX thread. The fix rejects a frame whose reported length is smaller than IEEE802154_FCS_LENGTH before the subtraction, and replaces the compiled-out assertion with a runtime length check that drops oversized frames — matching the runtime check already present in drivers/ieee802154/ieee802154_nrf5.c.
Характеристики атаки
Последствия
Строка CVSS v3.1