В ядре Linux устранена следующая уязвимость:
net: сериализовать проверку netif_running() в enqueue_to_backlog()
Syzbot сообщил об использовании плиты KASAN после освобождения в функции fib_rules_lookup(). Основная причина — состояние гонки, при котором пакеты могут выйти из очереди.
сброс при отмене регистрации устройства (например, при выходе из netns). Commit e9e4dd3267d0 («net: не обрабатывать невыполненную работу устройства во время отмены регистрации»)
введена безблокировочная проверка netif_running() в enqueue_to_backlog() для
предотвратить постановку пакетов в очередь на устройство, отменяющее регистрацию.
Однако это создает окно гонки TOCTOU. Передатчик без блокировки (например, veth_xmit) может пройти
проверка перед dev_close() очищает IFF_UP. Если передатчик, то
с задержкой,lush_all_backlogs() может запуститься и завершиться до передатчика
захватывает блокировку невыполненной работы и ставит пакет в очередь.
Затем пакет ускользает
флеш и запускает UAF позже при обработке. Исправьте это, переместив проверку netif_running() внутрь блокировки невыполненной работы. Это сериализует чек с работой сброса (который также захватывает блокировку).
Затем мы либо ставим пакет в очередь перед выполнением сброса (чтобы он был сброшен),
или проверьте netif_running() после завершения очистки/закрытия (чтобы он был удален).
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: net: serialize netif_running() check in enqueue_to_backlog() Syzbot reported a KASAN slab-use-after-free in fib_rules_lookup(). The root cause is a race condition where packets can escape the backlog flushing during device unregistration (e.g., during netns exit). Commit e9e4dd3267d0 ("net: do not process device backlog during unregistration") introduced a lockless netif_running() check in enqueue_to_backlog() to prevent queuing packets to an unregistering device. However, this creates a TOCTOU race window. A lockless transmitter (like veth_xmit) can pass the check before dev_close() clears IFF_UP. If the transmitter is then delayed, flush_all_backlogs() can run and finish before the transmitter grabs the backlog lock and queues the packet. The packet then escapes the flush and triggers UAF later when processed. Fix this by moving the netif_running() check inside the backlog lock. This serializes the check with the flush work (which also grabs the lock). We then either queue the packet before the flush runs (so it gets flushed), or check netif_running() after the flush/close completes (so it gets dropped).
Характеристики атаки
Последствия
Строка CVSS v3.1
Уязвимые продукты 8
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
4.2
|
7.1.5
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
4.2
|
7.2-rc1
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
3.2.71
|
— |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
3.4.111
|
— |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
3.12.48
|
— |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
3.14.54
|
— |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
3.18.22
|
— |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
4.1.9
|
— |