CVE-2026-102961: Race between IP fragment reassembly and its timeout handler causes use-after-free in the Zephyr IPv6, IPv4 and 6LoWPAN stacks
Zephyr's IPv6, IPv4 and IEEE 802.15.4 (6LoWPAN) fragment reassembly implementations each keep a global reassembly cache that two threads modify with no synchronization. In the IPv6 code in subsys/net/ip/ipv6fragment.c, the receive path runs netipv6handlefragmenthdr() and reassemblepacket(), and the reassemblytimeout() delayable-work handler runs on the system workqueue. When a datagram completes, reassemblepacket() calls only the non-synchronous kworkcanceldelayable(), which does not stop a timeout handler that is already running. Separately, reassemblyget() treats a slot as free as soon as its timer is no longer pending, even while that slot's handler is still running. The IPv4 code in subsys/net/ip/ipv4fragment.c has the same structure. In the 6LoWPAN code in subsys/net/l2/ieee802154/ieee8021546lofragment.c, the reasstimeout() handler frees a cache entry's packet and releases the entry while fragmentaddtocache() on the receive path may still be using it, and setreasscache() re-initializes the entry's timer on every allocation.
A remote, unauthenticated attacker who can send fragmented packets to a device built with CONFIGNETIPV6FRAGMENT, CONFIGNETIPV4FRAGMENT or CONFIGNETL2IEEE802154FRAGMENT (for 6LoWPAN, from within IEEE 802.15.4 radio range) can time fragments around the reassembly timeout. In the IPv6 code two interleavings are reachable. In the first, the timeout handler frees the stored fragments with reassemblycancel() while the receive path is still merging them. In the second, the receive path reuses the slot and frees a stale first fragment while the handler is blocked inside neticmpv6senderror() still using that fragment as the source of the ICMPv6 Time Exceeded message. The race is widest with preemptive network threads, driver-context receive processing, or SMP. With the default cooperative threads on a single core, the attacker needs the handler to block while allocating a buffer.
Winning the race causes use-after-free, double free of netpkt objects, or a NULL pointer dereference in the network receive or workqueue thread. The typical result is a crash, which is a remote denial of service. The fixes add a mutex to each implementation that serializes its cache between the receive path and the timeout handler (and, for IPv6 and IPv4, the slot iterator netipv6fragforeach() / netipv4fragforeach()), and make a handler whose entry was released or reused while it waited leave that entry alone. The IPv6 fix also detaches the first fragment before sending the ICMPv6 error, and the 6LoWPAN fix initializes the entry timers once instead of on every allocation.