CVE-2026-143276: tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack()
In the Linux kernel, the following vulnerability has been resolved:
tcp: ipv6: do not read ireq->pktopts from tcpv6sendsynack()
When IPV6FLFREFLECT is set on a listener, or the net.ipv6.flowlabelreflect sysctl has FLOWLABELREFLECTESTABLISHED, tcpv6sendsynack() reflects the flowlabel of the SYN packet, reading it from the skb stored in ireq->pktopts.
Since commit 079096f103fa ("tcp/dccp: install synrecv requests into ehash table"), request sockets are processed without holding the listener lock. A cpu can then process a retransmitted SYN for a request socket, and send a SYNACK from tcpcheckreq(), while another cpu receives the ACK completing the 3WHS. tcpv6synrecvsock() consumes ireq->pktopts when it wins the hashdance, and the first cpu reads a freed skb:
BUG: KASAN: slab-use-after-free in tcpv6sendsynack (include/linux/skbuff.h:3152 include/linux/ipv6.h:110 net/ipv6/tcpipv6.c:582) Read of size 8 at addr ffff88802b08b608 by task poc-ipv6-pktopt/5076
Call Trace: <IRQ> tcpv6sendsynack (include/linux/skbuff.h:3152 include/linux/ipv6.h:110 net/ipv6/tcpipv6.c:582) tcprtxsynack (net/ipv4/tcpoutput.c:4719) tcpcheckreq (net/ipv4/tcpminisocks.c:762) tcpv6rcv (net/ipv6/tcpipv6.c:1826) ip6protocoldeliverrcu (net/ipv6/ip6input.c:479) ip6inputfinish (net/ipv6/ip6input.c:534) ip6input (include/linux/netfilter.h:325 include/linux/netfilter.h:319 net/ipv6/ip6input.c:545) ipv6rcv (include/net/dst.h:481 net/ipv6/ip6input.c:119 include/linux/netfilter.h:325 include/linux/netfilter.h:319 net/ipv6/ip6input.c:351)
Freed by task 5074 on cpu 0 at 15.412249s: kmemcachefree (include/linux/kasan.h:235 mm/slub.c:2780 mm/slub.c:6630 mm/slub.c:6757) tcpv6synrecvsock (net/ipv6/tcpipv6.c:1528) tcpcheckreq (net/ipv4/tcpminisocks.c:934) tcpv6rcv (net/ipv6/tcpipv6.c:1826) ip6protocoldeliverrcu (net/ipv6/ip6input.c:479) ip6inputfinish (net/ipv6/ip6input.c:534)
Request socket migration has the same issue: reqskmigratereset() transfers ireq->pktopts to the clone, which can be freed while another cpu holding a reference on the old request socket is still sending a SYNACK.
The SYNACK timer itself is not an issue, because inetcskreqskqueuedrop() calls timerdeletesync().
Save the flowlabel of the SYN in the request socket instead, so that tcpv6sendsynack() no longer needs ireq->pktopts.
As a side effect, the flowlabel is also reflected for SYN packets reusing a TIMEWAIT socket, as ireq->pktopts is not set in this case.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.120 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.66 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.7
Event History
Frequently Asked Questions
Which systems are exposed to this race condition?
Linux systems with IPv6 TCP listeners are exposed when a listener has IPV6_FL_F_REFLECT set or when net.ipv6.flowlabel_reflect includes FLOWLABEL_REFLECT_ESTABLISHED. The issue requires the flow label of an incoming SYN to be reflected in a SYN-ACK.
What traffic pattern is needed to trigger the issue?
The race requires concurrent handling of a retransmitted SYN and the ACK that completes the TCP three-way handshake for the same request socket. One CPU can send a SYN-ACK while another completes the connection and consumes the packet-options skb.
What can be done if the kernel cannot be updated immediately?
Avoid enabling flow-label reflection for affected IPv6 TCP listeners, including the listener-level IPV6_FL_F_REFLECT setting and the FLOWLABEL_REFLECT_ESTABLISHED sysctl behavior. This removes the affected SYN-ACK flow-label reflection path.
How might an affected system present the problem?
A kernel built with KASAN may report a slab use-after-free in tcp_v6_send_synack(), with call paths including tcp_rtx_synack() and tcp_check_req(). The report can occur while processing a SYN retransmission during connection establishment.