gptp_mi_qualify_announce() в subsys/net/l2/ethernet/gptp/gptp_mi.c проходит Path Trace TLV полученного сообщения IEEE 802.1AS Announce, сравнивая каждый идентификатор часов с локальным. Связка цикла была взята исключительно из контролируемого злоумышленником поля провода announce->steps_removed (принятого до 254), а не из announce->tlv.len, который является полем, которое указывает, сколько идентичностей на самом деле несет TLV. Поскольку path_sequence является гибким членом провода TLV (struct gptp_path_trace_tlv) и GPTP_ANNOUNCE() выдает сырой указатель в принятый буфер пакетов, memcmp() внутри цикла может обращаться к памяти далеко за пределами конца принятого кадра.
Единственная проверка длины стека, GPTP_ANNOUNCE_CHECK_LEN (), требует, чтобы принятая полезная нагрузка gPTP составляла ровно 68 + tlv.len байтов - поэтому она не ограничивает цикл, она гарантирует отсутствие данных. Непроверенный злоумышленник на том же сегменте Ethernet может отправить один кадр Announce, объявляющий tlv.len 0 с steps_removed 254; кадр проходит путь проверки длины и приема (net_gptp_recv() gptp_handle_msg() gptp_mi_qualify_announce()), который не выполняет аутентификацию, и цикл затем читает 255 записей по 8 байт каждая — около 2 KB — за пределами конца сетевого буфера. Воздействие является чтением out-of-bounds.
Прочитанные байты используются только в качестве операнда memcmp () и никогда не возвращаются злоумышленнику, поэтому не происходит значимого раскрытия информации; практический риск заключается в том, что перечитанный пересекает границу пула сетевого буфера в не отображенную или защищенную MPU память и сбивает сетевой поток RX, вызывая отказ в обслуживании. Экспозиция ограничена сборками, которые позволяют использовать экспериментальный CONFIG_NET_GPTP (развертывания TSN / AVB) и злоумышленникам с смежностью уровня 2, поскольку кадры gPTP отправляются на локальный адрес многоадресной рассылки и не маршрутизируются. Фикс вычисляет истинное количество входов как tlv.len / GPTP_CLOCK_ID_LEN и отклоняет объявление, когда steps_removed + 1 превышает его, поэтому цикл больше не может проходить мимо данных, проверенных проверкой длины пакета.
Показать оригинальное описание (EN)
gptp_mi_qualify_announce() in subsys/net/l2/ethernet/gptp/gptp_mi.c walks the Path Trace TLV of a received IEEE 802.1AS Announce message, comparing each clock identity against the local one. The loop bound was taken solely from the attacker-controlled wire field announce->steps_removed (accepted up to 254), never from announce->tlv.len, which is the field that states how many identities the TLV actually carries. Because path_sequence is the flexible member of the wire TLV (struct gptp_path_trace_tlv) and GPTP_ANNOUNCE() yields a raw pointer into the received packet buffer, the memcmp() inside the loop can address memory well past the end of the received frame. The stack's only length validation, GPTP_ANNOUNCE_CHECK_LEN(), requires the received gPTP payload to be exactly 68 + tlv.len bytes — so it does not constrain the loop, it guarantees the data is absent. An unauthenticated attacker on the same Ethernet segment can send a single Announce frame declaring tlv.len = 0 with steps_removed = 254; the frame passes the length check and reception path (net_gptp_recv() → gptp_handle_msg() → gptp_mi_qualify_announce()), which performs no authentication, and the loop then reads 255 entries of 8 bytes each — about 2 KB — beyond the end of the network buffer. The impact is an out-of-bounds read. The bytes read are only used as a memcmp() operand and are never returned to the attacker, so there is no meaningful information disclosure; the practical risk is that the overread crosses a network buffer pool boundary into unmapped or MPU-protected memory and faults the networking RX thread, causing a denial of service. Exposure is limited to builds that enable the opt-in, experimental CONFIG_NET_GPTP (TSN/AVB deployments) and to attackers with layer-2 adjacency, since gPTP frames are sent to a link-local multicast address and are not routed. The fix computes the true entry count as tlv.len / GPTP_CLOCK_ID_LEN and rejects the announce when steps_removed + 1 exceeds it, so the loop can no longer run past the data the packet-length check proved present.
Характеристики атаки
Последствия
Строка CVSS v3.1