В ядре Linux устранена следующая уязвимость:
inet: frags: исправлено использование после освобождения, вызванное сбросом fqdir_pre_exit()
При демонтаже netns функция fqdir_pre_exit() просматривает хеш-таблицу fqdir и
очищает каждую очередь фрагментов, которая еще не завершена, используя
inet_frag_queue_flush(). Этот помощник освобождает все skbs, находящиеся в очереди на
очередь фрагментов, но не устанавливает INET_FRAG_COMPLETE и оставляет
q->fragments_tail и q->last_run_head, указывающие на освобожденные skbs. Сама очередь остается в хеш-таблице.
fqdir_pre_exit() сначала снижает значение high_thresh до 0, чтобы остановить поиск новых очередей,
но он не может остановить фрагмент, который уже получил очередь через
inet_frag_find() ранее и остановился непосредственно перед блокировкой очереди.
Как только этот фрагмент возобновит работу после сброса и получит блокировку очереди,
он проходит проверку INET_FRAG_COMPLETE, а затем разыменовывает освобожденный
фрагменты_хвост. inet_frag_queue_insert() читает FRAG_CB() и ->len
этот указатель и в пути добавления пишет ->next_frag, вызывая
использование плиты после бесплатного использования. Сборка IPv6, nf_conntrack_reasm6 и 6lowpan
имеют один и тот же путь очистки и также затрагиваются. Сбросьте rb_fragments, фрагменты_хвост и последний_заголовок в
inet_frag_queue_flush(), поэтому очищаемая очередь больше не указывает на
освободил скбс.
Фрагмент, который возобновляется после сброса и принимает
блокировка очереди затем находит пустую очередь и запускает новый запуск вместо
разыменование освобожденного фрагмента_хвоста. ip_frag_reinit() уже
выполнил этот сброс после собственной очистки, поэтому удалите дубликат
код там.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: inet: frags: fix use-after-free caused by the fqdir_pre_exit() flush On netns teardown, fqdir_pre_exit() walks the fqdir rhashtable and flushes every fragment queue that is not yet complete using inet_frag_queue_flush(). That helper frees all the skbs queued on the fragment queue but does not set INET_FRAG_COMPLETE, and leaves q->fragments_tail and q->last_run_head pointing at the freed skbs. The queue itself stays in the rhashtable. fqdir_pre_exit() first lowers high_thresh to 0 to stop new queue lookups, but it cannot stop a fragment that already obtained the queue through inet_frag_find() earlier and stalled just before taking the queue lock. Once that fragment resumes after the flush and takes the queue lock, it passes the INET_FRAG_COMPLETE check and then dereferences the freed fragments_tail. inet_frag_queue_insert() reads FRAG_CB() and ->len of that pointer and, on the append path, writes ->next_frag, causing a slab use-after-free. IPv6, nf_conntrack_reasm6 and 6lowpan reassembly share the same flush path and are affected as well. Reset rb_fragments, fragments_tail and last_run_head in inet_frag_queue_flush() so a flushed queue no longer points at the freed skbs. A fragment that resumes after the flush and takes the queue lock then finds an empty queue and starts a new run instead of dereferencing the freed fragments_tail. ip_frag_reinit() already performed this reset after its own flush, so drop the now duplicate code there.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 18
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.18.3
|
6.18.36
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19.1
|
7.0.13
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.12.93:*:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:-:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:rc2:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:rc3:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:rc4:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:rc5:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:rc6:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:rc7:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:rc8:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc1:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc2:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc3:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc4:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc5:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc6:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc7:*:*:*:*:*:*
|
— | — |