В ядре Linux устранена следующая уязвимость:
Ice: исправлено двойное освобождение tx_buf skb. В случае сбоя Ice_tso() или Ice_tx_csum() путь ошибки в
Ice_xmit_frame_ring() освобождает skb, но «первый» tx_buf все еще указывает
к нему и помечается как действительный (ICE_TX_BUF_SKB).
'next_to_use' остается неизменным, поэтому потенциальная проблема будет устранена.
скорее всего, исправится, когда будет передан следующий пакет и tx_buf
перезаписывается. Но если следующего пакета нет и интерфейс
вместо этого отключили Ice_clean_tx_ring() -> Ice_unmap_and_free_tx_buf()
найдет tx_buf и освободит skb во второй раз.
Исправление состоит в том, чтобы сбросить тип tx_buf на ICE_TX_BUF_EMPTY в ошибке.
путь, так что Ice_unmap_and_free_tx_buf(). Переместите инициализацию «first» вверх, чтобы убедиться, что она уже действительна в
случае мы попадаем на путь ошибки линеаризации. Ошибка была обнаружена ИИ, пока он искал что-то другое.
Также предложена первоначальная версия патча. Я воспроизвел ошибку и протестировал ее исправление, добавив код для внедрения.
сбои, на сборке с KASAN. Я искал подобные ошибки в соответствующих драйверах Intel и не нашел.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: ice: fix double-free of tx_buf skb If ice_tso() or ice_tx_csum() fail, the error path in ice_xmit_frame_ring() frees the skb, but the 'first' tx_buf still points to it and is marked as valid (ICE_TX_BUF_SKB). 'next_to_use' remains unchanged, so the potential problem will likely fix itself when the next packet is transmitted and the tx_buf gets overwritten. But if there is no next packet and the interface is brought down instead, ice_clean_tx_ring() -> ice_unmap_and_free_tx_buf() will find the tx_buf and free the skb for the second time. The fix is to reset the tx_buf type to ICE_TX_BUF_EMPTY in the error path, so that ice_unmap_and_free_tx_buf(). Move the initialization of 'first' up, to ensure it's already valid in case we hit the linearization error path. The bug was spotted by AI while I had it looking for something else. It also proposed an initial version of the patch. I reproduced the bug and tested the fix by adding code to inject failures, on a build with KASAN. I looked for similar bugs in related Intel drivers and did not find any.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 5
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
4.17
|
7.0.10
|
|
Redhat Enterprise_Linux
cpe:2.3:o:redhat:enterprise_linux:7.0:*:*:*:*:*:*:*
|
— | — |
|
Redhat Enterprise_Linux
cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:*
|
— | — |
|
Redhat Enterprise_Linux
cpe:2.3:o:redhat:enterprise_linux:9.0:*:*:*:*:*:*:*
|
— | — |
|
Redhat Enterprise_Linux
cpe:2.3:o:redhat:enterprise_linux:10.0:*:*:*:*:*:*:*
|
— | — |