В ядре Linux устранена следующая уязвимость:
af_unix: Отсоединить scc_entry в unix_del_edge(). Кайл Цзэн сообщил, что GC может частично освободить мертвый SCC. Сценарий следующий:
1) Создайте два SCC:
Х-.
А <-> Б
^--'
2) Запустите одновременно следующее:
2-1) send() sk-B в sk-B из sk-X
2-2) закрыть() как A, так и B
В 2-1) есть небольшое окно, где unix_add_edges()
публикует новое ребро (B <-> B) в GC, но его skb не ставится в очередь
с помощью skb_queue_tail(). Если 2-2) завершается до запуска skb_queue_tail() и GC,
он считает A <-> B мертвым, но B не освобождается, потому что GC не может
соберите еще не поставленный в очередь skb, содержащий ребро B <-> B. Х-.
А <-> Б -. Этот край виден ^--' ^..' но скб нет Само по себе это не проблема, поскольку следующий запуск GC определит Би тоже мертв и освободи его наконец. Х-.
А <.> Б -.
^--' ^--'
Однако SCC X заставляет следующий GC вызвать unix_walk_scc_fast(),
и он перебирает A через scc_entry B. Давайте отключим scc_entry перед освобождением вершины в unix_del_edge().
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: af_unix: Unlink scc_entry in unix_del_edge(). Kyle Zeng reported that GC could free a dead SCC partially. The scenario is as follows: 1) Create two SCCs: X -. A <-> B ^--' 2) Run the following concurrently: 2-1) send() sk-B to sk-B from sk-X 2-2) close() both A and B At 2-1), there is a small window where unix_add_edges() publishes a new edge (B <-> B) to GC but its skb is not queued by skb_queue_tail(). If 2-2) completes before skb_queue_tail() and GC is triggered, it judges A <-> B as dead, but B is not freed because GC cannot collect the not-yet-queued skb holding the B <-> B edge. X -. A <-> B -. This edge is visible ^--' ^..' but skb is not This itself is not a problem since the next GC run will judge B as dead as well and free it finally. X -. A <.> B -. ^--' ^--' However, X's SCC forces the next GC to call unix_walk_scc_fast(), and it iterates over A through B's scc_entry. Let's unlink scc_entry before freeing the vertex in unix_del_edge().
Характеристики атаки
Последствия
Строка CVSS v3.1