Subject: Re: [PATCH net v2] net: skbuff: propagate shared-frag marker through frag-transfer helpers

From: Jakub Kicinski <[email-masked]>
Date: Thu, 14 May 2026 16:38:02 -0700

On Thu, 14 May 2026 17:45:45 +0200 Sabrina Dubroca wrote:
> 2026-05-14, 08:37:19 -0600, David Ahern wrote:
> > On 5/14/26 4:21 AM, Sabrina Dubroca wrote:  
> > > It would close this group of vulnerabilities, but there are other
> > > parts of the networking stack that consume this flag. For those,
> > > chasing missing flag propagation is still a useful task.
> > >   
> > 
> > Seems like this should be an skb helper to manage the flag with really
> > good documentation on when it needs to be set, reset and propagated.
> > 
> > I walked skbuff.c yesterday as well, and there are several places where
> > it is not clear if the flag needs to be propagated or not.  
> 
> Or maybe even something like a skb_transfer_frag that handles updating
> the frags array and copying the flag. Then we wouldn't have to chase
> functions that mess with frags[] directly and forget to also adjust
> flags.

FWIW IMHO I'm not sure this flag is worth the effort. Most of the code,
IIUC, needs to look at it for crypto. And for crypto it's cleaner to
allocate fresh pages for the output. That way the code has the same
perf whether frags were indeed shared or not. Vide tls. And non-perf
sensitive code can always cow frags.