Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: almasrymina@google.com
Cc: netdev@vger.kernel.org, edumazet@kernel.org,
	ncardwell@google.com, kuniyu@google.com, davem@davemloft.net,
	kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
	sdf@fomichev.me, kaiyuanz@google.com, willemb@google.com,
	daniel@iogearbox.net, josef@toxicpanda.com, sdf.kernel@gmail.com,
	dtatulea@nvidia.com, asml.silence@gmail.com,
	bobbyeshleman@meta.com
Subject: Re: [PATCH net-next v6 3/7] tcp: fix unreadable net_iov handling in tcp_clone_payload()
Date: Tue, 24 Nov 2026 08:14:24 +0000	[thread overview]
Message-ID: <179550806424.3135.7651051023866457294@kernel.org> (raw)
In-Reply-To: <20261120201408.3445445-4-almasrymina@google.com>

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

  parent reply	other threads:[~2026-11-24  8:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 20:14 [PATCH net-next v6 0/7] net: prevent mixing incompatible memory providers in skbs Mina Almasry
2026-11-20 20:14 ` [PATCH net-next v6 1/7] net: fix skb->unreadable propagation in skb_split() and skb_shift() Mina Almasry
2026-11-20 20:14 ` [PATCH net-next v6 2/7] net: devmem: prevent mixing TX bindings and reject non-devmem xmit Mina Almasry
2026-11-23 17:29   ` Stanislav Fomichev
2026-11-20 20:14 ` [PATCH net-next v6 3/7] tcp: fix unreadable net_iov handling in tcp_clone_payload() Mina Almasry
2026-11-23 17:29   ` Stanislav Fomichev
2026-11-24  8:14   ` netdev-bot+sashiko [this message]
2026-11-20 20:14 ` [PATCH net-next v6 4/7] tcp: propagate skb_zcopy() uarg in tcp_mtu_probe() Mina Almasry
2026-11-24  8:14   ` netdev-bot+sashiko
2026-11-20 20:14 ` [PATCH net-next v6 5/7] net: kunit: attach net_iov frags to target skbs in unreadable tests Mina Almasry
2026-11-23 17:29   ` Stanislav Fomichev
2026-11-24  8:14   ` netdev-bot+sashiko
2026-11-20 20:14 ` [PATCH net-next v6 6/7] net: prevent mixing frags from different memory providers or bindings Mina Almasry
2026-11-23 17:30   ` Stanislav Fomichev
2026-11-24  8:14   ` netdev-bot+sashiko
2026-11-20 20:14 ` [PATCH net-next v6 7/7] net: kunit: test incompatible memory provider rejection Mina Almasry
2026-11-23 17:31   ` Stanislav Fomichev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179550806424.3135.7651051023866457294@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=almasrymina@google.com \
    --cc=asml.silence@gmail.com \
    --cc=bobbyeshleman@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=kaiyuanz@google.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf.kernel@gmail.com \
    --cc=sdf@fomichev.me \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox