В ядре Linux устранена следующая уязвимость:
Ice: запретить выделение кольца tstamp для типов VSI, не относящихся к PF. Битовая карта pf->txtime_txqs отслеживает, какие очереди Tx имеют ETF (самый ранний
TxTime First) разгрузка включена. Это растровое изображение индексируется по номеру очереди.
и устанавливается функцией Ice_offload_txtime(), которая работает только с PF VSI.
очереди.
Однако Ice_is_txtime_ena() не проверяет тип VSI перед
сверяясь с растровым изображением. Когда разгрузка ETF включена в очереди PF Tx 0,
бит 0 установлен в pf->txtime_txqs. Во время последующего сброса PCI
перестроить, очередь Tx CTRL VSI 0 переконфигурируется и
Ice_is_txtime_ena() вызывается для этого кольца.
Поскольку он проверяет только
pf->txtime_txqs по индексу очереди без различения типа VSI, это
находит установленный бит 0 и возвращает true, что соответствует очереди ETF PF VSI,
а не CTRL VSI. Это приводит к тому, что Ice_vsi_cfg_txq() ложно
выделите tstamp_ring для кольца CTRL VSI. Поскольку кольца CTRL VSI не имеют связанного с ним netdev, Ice_clean_tx_ring()
принимает ранний возврат при проверке !netdev перед достижением
Ice_free_tx_tstamp_ring(), утечка выделения.
Каждый сброс PCI
утечка одного 64-байтового файла tstamp_ring. Исправьте это, ограничив функцию Ice_is_txtime_ena() возвращать true только для
Звонки PF VSI, поскольку txtime_txqs имеет смысл только для очередей PF VSI.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: ice: prevent tstamp ring allocation for non-PF VSI types The pf->txtime_txqs bitmap tracks which Tx queues have ETF (Earliest TxTime First) offload enabled. This bitmap is indexed by queue number and is set by ice_offload_txtime(), which only operates on PF VSI queues. However, ice_is_txtime_ena() does not check the VSI type before consulting the bitmap. When ETF offload is enabled on PF Tx queue 0, bit 0 is set in pf->txtime_txqs. During a subsequent PCI reset rebuild, the CTRL VSI's Tx queue 0 is reconfigured and ice_is_txtime_ena() is called for that ring. Since it only checks pf->txtime_txqs by queue index without distinguishing VSI type, it finds bit 0 set and returns true, matching the PF VSI's ETF queue, not the CTRL VSI's. This causes ice_vsi_cfg_txq() to spuriously allocate a tstamp_ring for the CTRL VSI ring. Since CTRL VSI rings have no associated netdev, ice_clean_tx_ring() takes an early return at the !netdev check before reaching ice_free_tx_tstamp_ring(), leaking the allocation. Each PCI reset leaks one 64-byte tstamp_ring. Fix this by restricting ice_is_txtime_ena() to return true only for PF VSI rings, since txtime_txqs is only meaningful for PF VSI queues.