CVE-2026-139210: tcp: reject devmem tx with fastopen and repair
In the Linux kernel, the following vulnerability has been resolved:
tcp: reject devmem tx with fastopen and repair
tcpsendmsglocked() enforces that devmem TX can only proceed if the zero-copy path is active and a valid dmabuf binding exists. However, subsequent branches in tcpsendmsglocked() can still intercept the message before it reaches the devmem zero-copy loop:
1. TCP Fast Open (MSGFASTOPEN or DEFERCONNECT): If TCPFASTOPENCONNECT is set, the socket may have a valid dst with NETIFFSG (so zc == MSGZEROCOPY and binding is present), but tcpsendmsgfastopen() -> tcpsendsyndata() will use copypagefromiter() to byte-copy from the iterator. Since iovbase represents dma-buf offsets rather than user virtual addresses, this misinterprets offsets as user pointers and copies the caller's memory at those addresses into the SYN packet.
2. TCP repair mode: If tp->repair is enabled with TCPRECVQUEUE, tcpsendrcvq() similarly calls skbcopydatagramfromiter(), byte-copying from the iterator.
Neither path supports or makes sense for devmem transmission. Reject devmem sends inside the Fast Open and TCP repair branches when a devmem binding is present. Checking inside the tp->repair branch also covers the case where repair mode is enabled while skstreamwaitconnect() drops the socket lock.
Additionally, drop the !sockcerr gate from the devmem validation check and return sockcerr if set. Otherwise, if a valid SCMDEVMEMDMABUF is followed by a failing cmsg, sockc.dmabufid remains set while binding is not acquired, allowing the Fast Open and TCPRECVQUEUE repair paths to proceed and return before sockcerr is checked.
This pre-existing issue was identified by Sashiko AI review on commit 125755776bc6 ("tcp: reject non zerocopy devmem tx") and has not been hit in production.