net_if_ipv4_addr_rm() и net_if_ipv6_addr_rm() в subsys/net/ip/net_if.c безусловно называют net_if_addr_unref() по целевому адресу. Когда более раннее удаление не удалось завершить, потому что другая подсистема все еще содержала ссылку (стек TCP принимает одну на локальный адрес каждого соединения, в tcp_conn_new() и на connect()), адрес остается на месте с is_added очищенным и is_used все еще установлен. Второе удаление такого адреса снова уменьшило количество ссылок, поглотив ссылку, принадлежащую этому другому владельцу.
Когда он был последним, адресный слот был выпущен, его событие NET_EVENT_IPV*_ADDR_DEL выстрелило, и слот стал многоразовым, в то время как владелец по-прежнему считал, что у него есть ссылка. Каждый помощник поиска адресов соответствует is_used, а не is_added, поэтому наполовину удаленный адрес остается видимым для остальной части стека, а повторные удаления легко доступны с удаленного ввода. В IPv6 SLAAC узел на линии связи, который отправляет Router Advertisement с коротким действительным сроком службы, вызывает истечение срока действия адреса в отложенное состояние; освежающий Router Advertisement обрабатывается net_if_ipv6_addr_update_lifetime (), который перевооружает пожизненный таймер без восстановления ссылки, поэтому следующее истечение срока действия выполняет второе удаление.
С CONFIG_NET_IPV4_ACD и DHCPv4 повторяются поддельные конфликты ARP для арендного диска устройства dhcpv4_acd_event_handler() в вызов net_if_ipv4_addr_rm() более одного раза по одному и тому же адресу. Там, где CONFIG_USERSPACE включен, системные вызовы net_if_ipv4_addr_rm_by_index() и net_if_ipv6_addr_rm_by_index() позволяют непривилегированному потоку пользовательского режима детерминированно запускать один и тот же выпуск на стороне ядра. Воздействием является потеря настроенного адреса IP в то время как соединения все еще используют его, и поврежденное количество ссылок, которое распространяется: слот может быть передан на недавно добавленный адрес, и когда устаревший держатель позже срывается, net_if_addr_unref () решает адрес по значению и роняет единственную ссылку нового воплощения, удаляя живой адрес во второй раз.
Затронутые объекты - статические слоты массива, и счетчик никогда не уменьшается ниже нуля, поэтому нет повреждения памяти или раскрытия информации; следствием является отказ в обслуживании против сетевого подключения устройства, повторяемого в темпе злоумышленника. Исправление устраняет адрес, прежде чем касаться количества ссылок, и возвращает false без вызова net_if_addr_unref (), когда адрес уже помечен как удаленный, поэтому публичное удаление API больше не может потреблять ссылку, которой он не владеет.
Показать оригинальное описание (EN)
net_if_ipv4_addr_rm() and net_if_ipv6_addr_rm() in subsys/net/ip/net_if.c unconditionally called net_if_addr_unref() on the target address. When an earlier removal could not complete because another subsystem still held a reference (the TCP stack takes one on the local address of every connection, in tcp_conn_new() and on connect()), the address is left in place with is_added cleared and is_used still set. A second removal of such an address decremented the reference count again, consuming a reference owned by that other holder. When it was the last one, the address slot was released, its NET_EVENT_IPV*_ADDR_DEL event fired, and the slot became reusable while the holder still believed it owned a reference. Every address lookup helper matches on is_used and not on is_added, so a half-removed address stays visible to the rest of the stack and repeat removals are readily reachable from remote input. Under IPv6 SLAAC, an on-link node that sends a Router Advertisement with a short valid lifetime causes the address to expire into the deferred state; a refreshing Router Advertisement is handled by net_if_ipv6_addr_update_lifetime(), which re-arms the lifetime timer without restoring the reference, so the next expiry performs the second, reference-stealing removal. With CONFIG_NET_IPV4_ACD and DHCPv4, repeated spoofed ARP conflicts for the device's lease drive dhcpv4_acd_event_handler() into calling net_if_ipv4_addr_rm() more than once on the same address. Where CONFIG_USERSPACE is enabled, the net_if_ipv4_addr_rm_by_index() and net_if_ipv6_addr_rm_by_index() system calls let an unprivileged user-mode thread trigger the same kernel-side release deterministically. The impact is loss of a configured IP address while connections are still using it, and a corrupted reference count that propagates: the slot can be handed to a newly added address, and when the stale holder later tears down, net_if_addr_unref() resolves the address by value and drops the new incarnation's only reference, removing a live address a second time. The affected objects are static array slots and the counter is never decremented below zero, so there is no memory corruption or information disclosure; the consequence is denial of service against the device's network connectivity, repeatable at the attacker's pace. The fix resolves the address before touching the reference count and returns false without calling net_if_addr_unref() when the address is already marked as removed, so the public removal API can no longer consume a reference it does not own.
Характеристики атаки
Последствия
Строка CVSS v3.1