В ядре Linux устранена следующая уязвимость:
net: Ethernet: ti: icssg: просмотр статистики Guard PA
icssg_ndo_get_stats64() безоговорочно вызывает emac_get_stat_by_name()
с именами статистики FW PA независимо от того, является ли блок статистики PA
присутствует на оборудовании. emac_get_stat_by_name() уже охраняет
Поиск статистики PA с помощью `if (emac->prueth->pa_stats)`; когда этот указатель
равно NULL, поиск передается в netdev_err() и возвращает -EINVAL. Поскольку ndo_get_stats64 регулярно опрашивается сетевым стеком.
это создает тысячи записей журнала в форме:
icssg-prueth icssg1-eth end0: неверная статистика FW_RX_ERROR
Вторичным следствием является то, что возвращаемое значение int(-EINVAL)
неявно расширяется до беззнакового значения, близкого к ULLONG_MAX, при накоплении
в поля __u64 файла rtnl_link_stats64, незаметно повреждая
Счетчики rx_errors, rx_dropped и tx_dropped сообщаются по `ip -s link`. Все остальные пути кода с поддержкой PA в драйвере уже защищены
та же проверка `if (emac->prueth->pa_stats)`.
Примените ту же защиту здесь.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: net: ethernet: ti: icssg: guard PA stat lookups icssg_ndo_get_stats64() unconditionally calls emac_get_stat_by_name() with FW PA stat names regardless of whether the PA stats block is present on the hardware. emac_get_stat_by_name() already guards the PA stats lookup with `if (emac->prueth->pa_stats)`; when that pointer is NULL the lookup falls through to netdev_err() and returns -EINVAL. Because ndo_get_stats64 is polled regularly by the networking stack this produces thousands of log entries of the form: icssg-prueth icssg1-eth end0: Invalid stats FW_RX_ERROR A secondary consequence is that the int(-EINVAL) return value is implicitly widened to a near-ULLONG_MAX unsigned value when accumulated into the __u64 fields of rtnl_link_stats64, silently corrupting the rx_errors, rx_dropped and tx_dropped counters reported by `ip -s link`. Every other PA-aware code path in the driver is already guarded with the same `if (emac->prueth->pa_stats)` check. Apply the same guard here.