CVE-2026-98549: tcp: prevent collapsing skbs across boundary in rtx queue
In the Linux kernel, the following vulnerability has been resolved:
tcp: prevent collapsing skbs across boundary in rtx queue
tcpwritecollapsefence() sets TCPSKBCB(skb)->eor = 1 on tcpwritequeuetail(sk) to prevent skbs queued after a switch to device encryption from being collapsed into earlier skbs.
The fence is a no-op if all earlier data has already been transmitted when the switch happens: sk->skwritequeue is empty. The not yet acknowledged earlier skbs wait in sk->tcprtxqueue with eor 0.
On a subsequent retransmit or SACK shift, tcpretranstrycollapse() or tcpshiftskbdata() can then merge an skb queued after the switch into one queued before it.
Both users of the fence are affected:
- psp: devices only encrypt skbs with skb->decrypted set. The merged skb keeps decrypted = 0 from the earlier skb, so merged data sent after pspsockassocsettx() is retransmitted in cleartext.
- tls device offload: the merged skb straddles the start marker set in tlssetdeviceoffload(). The software fallback (fillsgin() returns -EINVAL) and the mlx5, nfp and funeth drivers cannot handle such an skb and drop it. Every retransmit rebuilds the same skb, so the connection stalls.
Fix this in two places, for defense in depth:
1. Fall back to tcprtxqueuetail(sk) in tcpwritecollapsefence() when tcpwritequeuetail(sk) is NULL.
2. Check !skbcmpdecrypted(to, from) in tcpskbcancollapse(), as tcpskbcancollapserx() does on receive. skbshift(), which both collapse paths call, already has a DEBUGNETWARNONONCE() for this condition.