๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by netdev-bot+sashiko Tue, 24 Nov 2026 08:14
Re: [PATCH net-next v6 3/7] tcp: fix unreadable net_iov handling in tcp_clone_payload()
#21590
Author: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 08:14
69 lines
10870 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message explains how the bug works but not what it
  does to users, and it calls the bug "theoretical".
- [Low] The commit message says the fix was "Verified with the net_core
  KUnit test suite".

--

tcp: fix unreadable net_iov handling in tcp_clone_payload()

This patch makes tcp_clone_payload() copy skb->unreadable from the write
queue skbs into the MTU probe skb. It also changes the frag merge check
from skb_frag_page() to skb_frag_netmem(), so that two different
unreadable net_iovs no longer compare equal as NULL == NULL.

> This issue is theoretical and was found by manual code inspection and
> LLM review; it was not triggered in production. Verified with the
> net_core KUnit test suite; not tested on real hardware.

[Severity: Low]
The message explains how the bug happens and calls it theoretical, but it
does not say what users would see. Could it describe the impact, so that
stable maintainers can judge how urgent the fix is?

Before this patch, the probe skb built by tcp_clone_payload() could hold
devmem net_iov frags while to->unreadable stayed 0. In
validate_xmit_unreadable_skb() in net/core/dev.c:

	if (likely(skb_frags_readable(skb) ||
		   dev->netmem_tx == NETMEM_TX_NO_DMA))
		goto out;

So the probe would skip the NETMEM_TX_NONE drop and the binding device
check. Other software paths that use skb_frags_readable() as their gate
would also treat the net_iov frags as pages, and skb_frag_page() returns
NULL for those.

The NULL == NULL check could also merge two different net_iovs into one
frag. This happens when one frag ends at offset X in niov A and the next
frag starts at offset X in niov B. zerocopy_fill_skb_from_devmem() takes
these offsets from the user's dmabuf iov addresses. A user can therefore
set this up, even with two iovs in a single sendmsg().

In that case, wouldn't the probe send the bytes that follow in niov A
instead of niov B's bytes? That would corrupt the TCP payload and send
dmabuf bytes the user never asked to send.

[Severity: Low]
Can the net_core KUnit suite actually run this change? tcp_clone_payload()
is static in net/ipv4/tcp_output.c. Its only call path is:

tcp_write_xmit()->tcp_mtu_probe()->tcp_clone_payload()

The only TCP test in net/core/net_test.c looks like
netmem_ref_test_tcp_devmem_recv(). It covers devmem receive and never
calls tcp_mtu_probe().

Would it be more accurate to say that the changed path was not run? The
other option would be to add a test that drives tcp_mtu_probe() with
devmem skbs.

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120201408.3445445-1-almasrymina%40google.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads