CVE-2026-99676 PUBLISHED

net: restore refcount ordering for lockless socket access

Assigner: Linux
Reserved: 25.09.2026 Published: 20.11.2026 Updated: 22.11.2026

In the Linux kernel, the following vulnerability has been resolved:

net: restore refcount ordering for lockless socket access

Before commit fb041bb7c0a9 ("locking/refcount: Consolidate implementations of refcount_t"), default builds implemented refcount_inc_not_zero() using atomic_add_unless(), which provided full memory ordering on success. The commit removed that ordering on weakly ordered architectures, allowing accesses after a successful reference acquisition to be reordered before it.

Use refcount_inc_not_zero_acquire() in the IPv4 and IPv6 established lookups and in inet_twsk_purge(), where the socket is validated again after taking a reference.

bpf_sk_assign() can receive a socket pointer obtained through BTF without a reference. Use acquire ordering when it takes its own reference for a refcounted socket.

Use refcount_set_release() when setting refcounts in the SYN cookie, TCP Fast Open, request migration, and TIME_WAIT paths. Keep the existing TIME_WAIT smp_wmb(), which separately orders the refcount store before ehash publication.

Metrics

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 9.8

AV:N - A TCP segment enters __inet_lookup_established() from tcp_v4_rcv() through __inet_lookup_skb(), and from tcp_v4_early_demux() in ip_rcv_finish_core(); tcp_v6_rcv() does the same via __inet6_lookup_established(). The header 4-tuple is the lookup key, and that segment is delivered to whatever socket the unordered refcount_inc_not_zero() returns. AC:L - The attacker produces the race by opening and closing connections and by completing SYN-cookie handshakes, so tcp_get_cookie_sock() and connect/close recycle SLAB_TYPESAFE_BY_RCU sockets while further segments enter the lookup. Relaxed refcount_inc_not_zero() does not order the following inet_match() or hlist_nulls_unhashed_lockless() recheck, and no victim action or hardware fault is required. PR:N - tcp_v4_rcv() and tcp_v4_early_demux() run on every incoming TCP segment before TCP-MD5, TCP-AO, or application authentication. Sending the segment to a listening port performs no credential check on this path. UI:N - The attacker both recycles the sockets and sends the racing segments. No local user must mount media, open a file, or accept a connection. S:U - The lookup, the recycled tcp_sock or request_sock, and any dst_entry reached from sk_rx_dst all belong to the host kernel. The bug does not cross a guest-to-host or IOMMU boundary. C:H - A load of sk_rx_dst after the relaxed refcount_inc_not_zero() can still observe the previous tcp_sock's route, which tcp_disconnect() already passed to dst_release(). tcp_v4_early_demux() and tcp_v4_do_rcv() then read dst->obsolete and call dst->ops->check on that freed dst_entry. I:H - tcp_v4_do_rcv() dispatches through the stale sk_rx_dst via dst->ops->check and can dst_release() it, writing a freed dst_entry. It also passes the attacker's segment to tcp_rcv_established() on the recycled socket, updating that socket's sequence state and receive queue. A:H - If reuse returns the unhashed SYN-cookie request published by tcp_get_cookie_sock(), its rsk_listener is NULL and tcp_v4_rcv() reads sk->sk_state at offset 0x12 through that NULL pointer in softirq, oopsing the host. The freed dst_entry dereference faults as well.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from fb041bb7c0a918b95c6889fc965cdc4a75b4c0ca to 6f4fc93f76cd8ebd3c89a064573715503048d1ad (excl.)
  • affected from fb041bb7c0a918b95c6889fc965cdc4a75b4c0ca to ddd14d0b5b5e650077779d9a158cb7a80ee8297b (excl.)
  • affected from fb041bb7c0a918b95c6889fc965cdc4a75b4c0ca to 52f5a5ab318f5b120eb686069fbd0108016c02b2 (excl.)
  • affected from fb041bb7c0a918b95c6889fc965cdc4a75b4c0ca to 5b5d8f351dd96f56a58bb516a80e2d4d742fe4e2 (excl.)
  • Version d0d583484d2ed9f5903edbbfa7e2a68f78b950b0 is affected
  • affected from 5.4.208 to 5.5 (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 5.5 is affected
  • unaffected from 0 to 5.5 (excl.)
  • unaffected from 6.12.118 to 6.12.* (incl.)
  • unaffected from 6.18.64 to 6.18.* (incl.)
  • unaffected from 7.3.5 to 7.3.* (incl.)
  • unaffected from 7.4-rc2 to * (incl.)

References