From: Stanislav Fomichev <sdf.kernel@gmail.com>
To: Mina Almasry <almasrymina@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
Kaiyuan Zhang <kaiyuanz@google.com>,
Eric Dumazet <edumazet@kernel.org>,
Willem de Bruijn <willemb@google.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Paolo Abeni <pabeni@redhat.com>,
Stanislav Fomichev <sdf@fomichev.me>,
"David S. Miller" <davem@davemloft.net>,
Simon Horman <horms@kernel.org>,
Neal Cardwell <ncardwell@google.com>,
Kuniyuki Iwashima <kuniyu@google.com>,
Bobby Eshleman <bobbyeshleman@meta.com>,
Pavel Begunkov <asml.silence@gmail.com>,
Daniel Borkmann <daniel@iogearbox.net>
Subject: Re: [PATCH net-next v3 2/2] net: prevent mixing frags from different memory providers or bindings
Date: Fri, 6 Nov 2026 14:22:43 -0800 [thread overview]
Message-ID: <au5SPWdVCuso8Esq@devvm16445.scu0.facebook.com> (raw)
In-Reply-To: <CAHS8izNrM+iaT6OOJVoZdVp00TkNRhFe9ucCVrwaUWL0oQS7Ow@mail.gmail.com>
On 11/06, Mina Almasry wrote:
> On Thu, Nov 5, 2026 at 8:59 AM Stanislav Fomichev <sdf.kernel@gmail.com> wrote:
> > > +static inline void *skb_net_iov_provider(const struct sk_buff *skb)
> > > +{
> > > + struct net_iov *niov;
> > > +
> >
> > [..]
> >
> > > + if (!skb_has_net_iovs(skb) || !skb_shinfo(skb)->nr_frags)
> > > + return NULL;
> >
> > (a few nits/questions)
> >
> > Why !skb_has_net_iovs is not enough? (and if !nr_frags is required,
> > maybe fold it into skb_has_net_iovs?)
> >
>
> Well skb_has_net_iovs only checks skb->unreadable, which is not
> actually enough. The skb doesn't necessarily have net_iovs if it's
> unreadable, it technically could be that it has no frags, right?
>
> Technically we should never have the edge case where
> skb->unreadable==true && skb_shinfo->nr_frags==0, but I don't think
> the code is careful about that today, and I don't know that I want to
> do a global refactor everywhere we remove frags, which skb-> flags
> need to be updated.
>
> but you're right that it can be folded.
Not sure I'm buying that, but happy to look again if you disagree. I think
the only way to make an skb unreadable right now is to add at least
one niov frag? Don't think this is (ever?) gonna change? What does
and unreadable skb without frags even means?
prev parent reply other threads:[~2026-11-06 22:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 4:25 [PATCH net-next v3 0/2] net: prevent mixing incompatible memory providers in skbs Mina Almasry
2026-11-04 4:25 ` [PATCH net-next v3 1/2] net: fix skb->unreadable propagation in skb_split() and skb_shift() Mina Almasry
2026-11-04 4:25 ` [PATCH net-next v3 2/2] net: prevent mixing frags from different memory providers or bindings Mina Almasry
2026-11-05 16:57 ` Stanislav Fomichev
2026-11-06 19:34 ` Mina Almasry
2026-11-06 22:22 ` Stanislav Fomichev [this message]
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=au5SPWdVCuso8Esq@devvm16445.scu0.facebook.com \
--to=sdf.kernel@gmail.com \
--cc=almasrymina@google.com \
--cc=asml.silence@gmail.com \
--cc=bobbyeshleman@meta.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@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@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®