Thread (13 messages) 13 messages, 7 authors, 2025-08-30

Re: [PATCH v6 bpf] xsk: fix immature cq descriptor production

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2025-08-26 12:23:43
Also in: bpf

On 8/26/25 10:14 AM, Dan Carpenter wrote:
On Wed, Aug 20, 2025 at 05:44:16PM +0200, Maciej Fijalkowski wrote:
quoted
  			return ERR_PTR(err);
  
  		skb_reserve(skb, hr);
+
+		addrs = kmem_cache_zalloc(xsk_tx_generic_cache, GFP_KERNEL);
+		if (!addrs) {
+			kfree(skb);
This needs to be kfree_skb(skb);
Oh well, good catch! Maciej, given this commit did not land yet in Linus' tree,
I can toss the commit from bpf tree assuming you send a v7?

Also, looking at xsk_build_skb(), do we similarly need to free that allocated
skb when we hit the ERR_PTR(-EOVERFLOW) ? Mentioned function has the following
in the free_err path:

         if (first_frag && skb)
                 kfree_skb(skb);

Pls double check.
regards,
dan carpenter
quoted
+			return ERR_PTR(-ENOMEM);
+		}
+
+		xsk_set_destructor_arg(skb, addrs);
  	}
  
  	addr = desc->addr;
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help