Skip to contentSkip to conversation

xfrm: free the whole skb list on the packet offload drop

PATCH In review Wang Zhan 1 participant 2 messages Sep 20

Subsystems (3)
lore
Share & tools
lore

Wang Zhan

author
#0 lore raw

PATCH 1/1 xfrm: free the whole skb list on the packet offload drop

validate_xmit_skb() hands the segmentation result of one GSO packet down to validate_xmit_xfrm() as a list. The drop for a packet whose packet offload state no longer matches the device frees the first skb only, so the rest of the list and its payload are leaked.

Fixes f8a70afafc175 ("xfrm: add TX datapath support for IPsec packet offload mode")
Assisted-by LLM
---
 net/xfrm/xfrm_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/xfrm/xfrm_device.c +1 -1
index f153bf695b9dd..0fdd10d29fd1a 100644
@@ -140,7 +140,7 @@ struct sk_buff *validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t featur
 	 * XFRM stack.
 	 */
 	if (x->xso.type == XFRM_DEV_OFFLOAD_PACKET && x->xso.dev != dev) {
-		kfree_skb(skb);
+		kfree_skb_list(skb);
 		dev_core_stats_tx_dropped_inc(dev);
 		return NULL;
 	}
Signature · 1 line
2.47.3
author
#1 lore raw

Please ignore this patch. Re-reading the packet offload output path, I cannot construct a case where that drop sees a segmented list, so it is not fixing a reachable leak.

pw-bot: rejected