Re: [PATCH net-next v5 2/3] net: prevent mixing frags from different memory providers or bindings

From: Mina Almasry

Date: Thu Nov 19 2026 - 11:16:18 EST


On Wed, Nov 18, 2026 at 4:16 PM Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
>
> On Sun, 15 Nov 2026 00:40:02 +0000 Mina Almasry wrote:
> > Subject: [PATCH net-next v5 2/3] net: prevent mixing frags from different memory providers or bindings
>
> This patch needs to be split up. There seems to be pure refactoring
> here (validate_xmit_unreadable_skb())

That's actually a fix. Without this, iouring rcrx skbs forwarded could
end up going through a device to which they aren't mapped, afaiu. I
guess splitting the patches will make this more apparent.

> and the test code also should
> be in a separate patch. The rest needs a close look from perf
> perspective :S

FWIW I worked to minimize the impact, which is why the patch may look
a bit convoluted. We should load zero extra cache lines in the case
where both skbs are paged, and only load extra cachelines when we've
confirmed both skbs have memory providers in them and we need to do an
actual provider check. In the next version I will include some
analysis on that in the cover letter.

However, we still pay the cost of the checks themselves.

>Lots of checks on the fast path to fix a hallucination..
>

I wasn't doing this because sashiko hallucinated it, I was more doing
it because I was aware that some mixing is possible, and saw folks
were trying to include some new memory providers (AF_XDP, PISA), and I
was worried some bot will be able to reproduce reliable crashes with
these edge cases and it becomes a real issue. I thought to fix it
before it became a real issue. Let me know if that's not valuable and
you want me to punt this; for now I'll follow your instruction and
repost with the split.


--
Thanks,
Mina