BPF List
 help / color / mirror / Atom feed
From: Octavian Purdila <tavip@google.com>
To: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	 Willem de Bruijn <willemb@google.com>,
	Simon Horman <horms@kernel.org>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	Neal Cardwell <ncardwell@google.com>,
	 Kuniyuki Iwashima <kuniyu@google.com>,
	David Ahern <dsahern@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>,
	 John Fastabend <john.fastabend@gmail.com>,
	Jakub Sitnicki <jakub@cloudflare.com>,
	 Jiayuan Chen <jiayuan.chen@linux.dev>,
	Sabrina Dubroca <sd@queasysnail.net>,
	 Shuah Khan <shuah@kernel.org>,
	Mina Almasry <almasrymina@google.com>,
	 Stanislav Fomichev <sdf@fomichev.me>,
	Kaiyuan Zhang <kaiyuanz@google.com>,
	 Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	 Matteo Croce <mcroce@microsoft.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	 Edward Cree <ecree.xilinx@gmail.com>,
	bpf@vger.kernel.org,  linux-kselftest@vger.kernel.org
Subject: [PATCH net 00/10] net: fix unreadable net_iov skb handling across networking paths
Date: Thu,  3 Dec 2026 21:09:10 +0000	[thread overview]
Message-ID: <cover.1796329894.git.tavip@google.com> (raw)

Device-memory TCP and io_uring zcrx bind RX queues to page_pool memory
providers whose net_iov fragments cannot be mapped or read by the CPU.
While standard TCP devmem traffic uses flow steering onto isolated RX
queues, several networking paths either propagate stale skb metadata,
mix readable and unreadable fragments across frag_list, or attempt to
map or copy payload fragments on the CPU when unexpected protocol
traffic or socket options interact with unreadable skbs:

1. GRO fragment reuse and pull failure (patches 1-2): napi_frags_skb()
   calls napi_reuse_skb() while fragments remain attached on Ethernet
   header pull failure and napi_gro_frags() dereferences the resulting
   NULL skb; napi_reuse_skb() leaves stale skb->unreadable and
   skb->pp_recycle state on cached napi->skb heads.

2. IP fragment reassembly and generic skb helpers (patches 3-4): IP
   fragment reassembly permits mixing readable and unreadable fragments
   in the same queue and does not propagate head->unreadable to the
   frag_list wrapper skb, and skb_to_sgvec(), skb_send_sock_locked(),
   sockmap verdict processing, and strparser assume CPU-readable
   fragments.

3. kTLS RX and TCP-MD5 / TCP-AO (patches 5-6): kTLS tls_strp decryption
   and software TCP-MD5 / TCP-AO payload hashing attempt to access
   unreadable net_iov fragments on the CPU.

Patches 1-6 fix these paths by freeing failed napi_frags_skb() skbs,
resetting cached GRO skb state, rejecting mixed-readability IP
fragments, and rejecting unreadable fragments cleanly before CPU page
mapping occurs.

Patches 7-8 add KUnit regression tests in net_test covering the
napi_gro_frags, IP defrag, scatterlist, skmsg, and strparser paths and
verifying page_pool and dmabuf binding reference counts remain balanced.
Patches 9-10 extend devmem.py with end-to-end protocol regression tests
for kTLS RX and TCP-MD5 / TCP-AO RX and TX rejection.

Verified with net_core KUnit tests in QEMU and end-to-end devmem.py runs
over ConnectX-7 (mlx5_core) 400GbE hardware.

Octavian Purdila (10):
  net: gro: free skb on napi_frags_skb() header pull failure
  net: gro: reset unreadable and pp_recycle in napi_reuse_skb
  inet: frag: reject fragments with mixed readability in reassembly
  net: skbuff, skmsg, strparser: reject unreadable frags
  tls: reject unreadable skbs in tls_strp
  tcp: reject unreadable skbs on TCP-MD5 and TCP-AO
  net: kunit: test unreadable net_iov napi_gro_frags
  net: kunit: test unreadable net_iov defrag and skb helpers
  selftests: drv-net: devmem: test unreadable kTLS RX
  selftests: drv-net: devmem: test unreadable skbs on TCP-MD5 and TCP-AO

 include/net/inet_frag.h                       |   1 +
 include/net/tcp.h                             |  33 +-
 net/core/gro.c                                |   7 +-
 net/core/net_test.c                           | 628 +++++++++++++++++-
 net/core/skbuff.c                             |   8 +
 net/core/skmsg.c                              |  10 +
 net/ipv4/inet_fragment.c                      |  13 +-
 net/ipv4/tcp.c                                |  32 +-
 net/ipv4/tcp_ao.c                             |  29 +-
 net/ipv4/tcp_ipv4.c                           |  13 +-
 net/ipv4/tcp_output.c                         |   9 +-
 net/ipv6/tcp_ipv6.c                           |  10 +-
 net/strparser/strparser.c                     |   5 +
 net/tls/tls_strp.c                            |  24 +-
 tools/testing/selftests/drivers/net/hw/config |   2 +
 .../selftests/drivers/net/hw/devmem.py        |  17 +-
 .../selftests/drivers/net/hw/devmem_lib.py    | 445 ++++++++++++-
 .../drivers/net/hw/lib/py/__init__.py         |  11 +-
 18 files changed, 1247 insertions(+), 50 deletions(-)


base-commit: 90ae4042bd9f35a9098d14b1a12a43df9b326e2b
-- 
2.56.1.915.g69d5ec7298-goog


             reply	other threads:[~2026-12-03 21:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 21:09 Octavian Purdila [this message]
2026-12-03 21:09 ` [PATCH net 01/10] net: gro: free skb on napi_frags_skb() header pull failure Octavian Purdila
2026-12-03 21:09 ` [PATCH net 02/10] net: gro: reset unreadable and pp_recycle in napi_reuse_skb Octavian Purdila
2026-12-03 21:09 ` [PATCH net 03/10] inet: frag: reject fragments with mixed readability in reassembly Octavian Purdila
2026-12-03 21:09 ` [PATCH net 04/10] net: skbuff, skmsg, strparser: reject unreadable frags Octavian Purdila
2026-12-03 21:09 ` [PATCH net 05/10] tls: reject unreadable skbs in tls_strp Octavian Purdila
2026-12-03 21:09 ` [PATCH net 06/10] tcp: reject unreadable skbs on TCP-MD5 and TCP-AO Octavian Purdila
2026-12-03 21:09 ` [PATCH net 07/10] net: kunit: test unreadable net_iov napi_gro_frags Octavian Purdila
2026-12-03 21:09 ` [PATCH net 08/10] net: kunit: test unreadable net_iov defrag and skb helpers Octavian Purdila
2026-12-03 21:09 ` [PATCH net 09/10] selftests: drv-net: devmem: test unreadable kTLS RX Octavian Purdila
2026-12-03 21:09 ` [PATCH net 10/10] selftests: drv-net: devmem: test unreadable skbs on TCP-MD5 and TCP-AO Octavian Purdila

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=cover.1796329894.git.tavip@google.com \
    --to=tavip@google.com \
    --cc=almasrymina@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@kernel.org \
    --cc=hawk@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jakub@cloudflare.com \
    --cc=jiayuan.chen@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=kaiyuanz@google.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mcroce@microsoft.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sd@queasysnail.net \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    --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