Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider. Critical: 0 · High: 1 · Medium: 0 · Low: 1 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [High] The devmem MTU probe can still carry the wrong payload. - [Low] The commit message does not mention a behaviour change. -- tcp: Fix MTU probe with zerocopy or devmem skb. This patch copies the ubuf_info (uarg) and skb->unreadable from the send queue head to the MTU probe skb that tcp_mtu_probe() builds. It also makes tcp_can_coalesce_send_queue_head() refuse to coalesce skbs whose skb_zcopy() pointers differ.
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c > index 043838d996404..be2ef1fe1ea00 100644 > --- a/net/ipv4/tcp_output.c > +++ b/net/ipv4/tcp_output.c > @@ -2660,7 +2660,8 @@ static bool tcp_can_coalesce_send_queue_head(struct sock *sk, int len) > if (len <= skb->len) > break; > > - if (tcp_has_tx_tstamp(skb) || !tcp_skb_can_collapse(skb, next)) > + if (tcp_has_tx_tstamp(skb) || !tcp_skb_can_collapse(skb, next) || > + skb_zcopy(skb) != skb_zcopy(next)) > return false;
[Severity: Low] This isn't a bug, but could the commit message mention this change in behaviour? The message only says: Let's propagate uarg and skb->unreadable to MTU probe skb. Before this patch, tcp_skb_can_collapse() only required the same pure-zerocopy state through skb_pure_zcopy_same(). With the new check, tcp_mtu_probe() returns -1 whenever the send queue head mixes zerocopy and non-zerocopy skbs, or holds zerocopy skbs with different ubuf_info. This can happen with io_uring SEND_ZC requests smaller than probe_size, since each one has its own notif uarg. It can also happen with MSG_ZEROCOPY sends whose uarg could not be extended. In those workloads, MTU probing stops raising the MSS without any notice. The restriction makes sense because nskb can only carry one uarg, but the changelog doesn't say so.
> > len -= skb->len; > @@ -2828,6 +2829,8 @@ static int tcp_mtu_probe(struct sock *sk) > sk_mem_charge(sk, nskb->truesize); > > skb = tcp_send_head(sk); > + nskb->unreadable = skb->unreadable; > + skb_zcopy_set(nskb, skb_zcopy(skb), NULL);
[Severity: High] Now that nskb is marked unreadable, the devmem probe passes validate_xmit_unreadable_skb() and goes out on the bound device. Can its payload still be wrong because of the way tcp_clone_payload() merges frags? net/ipv4/tcp_output.c:tcp_clone_payload() { ... if (lastfrag && skb_frag_page(fragfrom) == skb_frag_page(lastfrag) && skb_frag_off(fragfrom) == skb_frag_off(lastfrag) + skb_frag_size(lastfrag)) { skb_frag_size_add(lastfrag, todo); continue; } ... } skb_frag_page() returns NULL for every net_iov frag: include/linux/skbuff.h:skb_frag_page() { if (skb_frag_is_net_iov(frag)) return NULL; ... } So any two devmem frags pass the page check. If the next frag's offset equals the previous frag's offset plus its size, the next frag is folded into the previous one, even though it points at a different net_iov. Devmem TX offsets come straight from the user's iov addresses. net_devmem_get_niov_at() returns tx_vec[virt_addr / PAGE_SIZE] with off = virt_addr % PAGE_SIZE. zerocopy_fill_skb_from_devmem() then adds one frag per chunk without coalescing them. For example, an iov list of {0, 100}, {PAGE_SIZE + 100, X} gives: frag A = (niov0, off 0, len 100) frag B = (niov1, off 100, len X) B is then merged into A as (niov0, off 0, len 100 + X). The same can happen across skbs, for instance when 2048-byte chunks are sent as page0/off0 followed by page1/off2048. The NIC would compute a valid checksum over bytes from the wrong dma-buf chunk, so the peer accepts corrupted stream data. The probe skb also replaces the original skbs in the write queue through tcp_eat_one_skb() and __pskb_trim_head(), so retransmissions would send the same wrong bytes. The merge check is older than this patch. Since this patch is what lets the devmem probe be transmitted, should tcp_clone_payload() compare skb_frag_netmem() instead, the way skb_can_coalesce_netmem() does?
> skb_copy_decrypted(nskb, skb); > mptcp_skb_ext_copy(nskb, skb);
-- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40google.com