From: Mina Almasry <almasrymina@google.com>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Jakub Kicinski <kuba@kernel.org>,
Willem de Bruijn <willemb@google.com>,
Eric Dumazet <edumazet@kernel.org>,
Mina Almasry <almasrymina@google.com>,
Kaiyuan Zhang <kaiyuanz@google.com>,
io-uring@vger.kernel.org, Stanislav Fomichev <sdf@fomichev.me>,
Paolo Abeni <pabeni@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Simon Horman <horms@kernel.org>,
Pavel Begunkov <asml.silence@gmail.com>,
Jens Axboe <axboe@kernel.dk>,
Stanislav Fomichev <sdf.kernel@gmail.com>,
Bobby Eshleman <bobbyeshleman@meta.com>,
Daniel Borkmann <daniel@iogearbox.net>,
Neal Cardwell <ncardwell@google.com>,
Kuniyuki Iwashima <kuniyu@google.com>,
David Ahern <dsahern@kernel.org>,
Ido Schimmel <idosch@nvidia.com>
Subject: [PATCH net-next v2 0/4] net: prevent mixing incompatible memory providers in skbs
Date: Mon, 2 Nov 2026 23:18:23 +0000 [thread overview]
Message-ID: <20261102231827.4088254-1-almasrymina@google.com> (raw)
Enforce that all fragments in a nonlinear skb come from compatible
memory providers (and for devmem, the exact same binding).
Patch 1 fixes skb->unreadable propagation in skb_split() and skb_shift().
Patch 2 stores mp_priv directly inside struct net_iov.
Patch 3 adds skb_has_net_iovs(), skb_mem_provider_compat(), and
skb_frags_can_coalesce().
Patch 4 enforces provider/binding compatibility across TX, TCP, GRO,
IP defrag, skb_shift(), and skb_try_coalesce().
v1 -> v2:
- Generalize the check across TX, TCP collapse, GRO, IP defrag,
skb_shift(), and skb_try_coalesce() by storing mp_priv directly in
struct net_iov and introducing skb_frags_can_coalesce().
- Fix skb->unreadable propagation in skb_split() and skb_shift().
- Add KUnit coverage for cross-provider and cross-binding rejection.
- v1: https://lore.kernel.org/netdev/20261008034027.1403188-1-almasrymina@google.com/
Mina Almasry (4):
net: fix skb->unreadable propagation in skb_split() and skb_shift()
netmem: store memory provider private pointer directly in struct
net_iov
net: add skb_frags_can_coalesce() helper
net: prevent mixing frags from different memory providers or bindings
include/linux/skbuff.h | 58 ++++++++++++++++++++++++++++++++++++++++
include/net/netmem.h | 15 +++++++++--
include/net/tcp.h | 5 ++--
io_uring/zcrx.c | 2 +-
net/core/datagram.c | 4 +--
net/core/dev.c | 14 +++-------
net/core/devmem.c | 3 ++-
net/core/devmem.h | 25 +++++++++++++++--
net/core/gro.c | 16 +++++------
net/core/net_test.c | 34 +++++++++++++++++------
net/core/skbuff.c | 34 ++++++++++++-----------
net/ipv4/inet_fragment.c | 3 +++
net/ipv4/tcp.c | 2 +-
net/ipv4/tcp_output.c | 3 +++
14 files changed, 163 insertions(+), 55 deletions(-)
base-commit: 4dd16e31135ea8437a720222df34e8745f385d6d
--
2.56.0.385.gac671c819a-goog
next reply other threads:[~2026-11-02 23:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 23:18 Mina Almasry [this message]
2026-11-02 23:18 ` [PATCH net-next v2 1/4] net: fix skb->unreadable propagation in skb_split() and skb_shift() Mina Almasry
2026-11-02 23:18 ` [PATCH net-next v2 2/4] netmem: store memory provider private pointer directly in struct net_iov Mina Almasry
2026-11-02 23:18 ` [PATCH net-next v2 3/4] net: add skb_frags_can_coalesce() helper Mina Almasry
2026-11-02 23:18 ` [PATCH net-next v2 4/4] net: prevent mixing frags from different memory providers or bindings Mina Almasry
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=20261102231827.4088254-1-almasrymina@google.com \
--to=almasrymina@google.com \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=bobbyeshleman@meta.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=io-uring@vger.kernel.org \
--cc=kaiyuanz@google.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®