Subject: Re: [PATCH 5/9] esp: fix page frag reference leak on skb_to_sgvec failure

From: Jakub Kicinski <[email-masked]>
Date: Fri, 29 May 2026 11:14:27 -0700

On Fri, 29 May 2026 07:52:07 +0200 Steffen Klassert wrote:
> > > -static void esp_ssg_unref(struct xfrm_state *x, void *tmp, struct sk_buff *skb)
> > > +static void esp_ssg_unref(struct xfrm_state *x, void *tmp, struct sk_buff *skb, bool already_unref)
> > >  {
> > >  	struct crypto_aead *aead = x->data;
> > >  	int extralen = 0;
> > > @@ -113,7 +113,7 @@ static void esp_ssg_unref(struct xfrm_state *x, void *tmp, struct sk_buff *skb)
> > >  	/* Unref skb_frag_pages in the src scatterlist if necessary.
> > >  	 * Skip the first sg which comes from skb->data.
> > >  	 */
> > > -	if (req->src != req->dst)
> > > +	if (already_unref || req->src != req->dst)
> > >  		for (sg = sg_next(req->src); sg; sg = sg_next(sg))
> > >  			skb_page_unref(page_to_netmem(sg_page(sg)),
> > >  				       skb->pp_recycle);  
> > 
> > Sashiko points the above is still unsafe:  
> 
> For the original patch submission, sashiko reported 'failed
> to apply' because it was targeted to the ipsec tree. Now
> with the full pull request it applied and it found issues,
> but now it is too late for me to fix this.
> 
> Would it be possible to integrate subtrees of net and net-next
> into the netdev CI? This would avoid such problems in future.

Sashiko is run by Google, tho. IDK why it fails to apply the patches
sometimes, happens for us too :(