From aec27311c23a8ce8eaf490762249d3ed74be83b6 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Wed, 6 Jul 2011 07:30:59 -0700 Subject: [PATCH] packet: Fix leak in pre-defrag support. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When we clone the SKB, we forget about the original one. Avoid this problem by using skb_share_check(). Reported-by: Penttilä Mika Signed-off-by: David S. Miller --- net/packet/af_packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 41f0489ff665..aec50a1e9849 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -476,7 +476,7 @@ static struct sk_buff *fanout_check_defrag(struct sk_buff *skb) return skb; if (ip_is_fragment(ip_hdr(skb))) { - skb = skb_clone(skb, GFP_ATOMIC); + skb = skb_share_check(skb, GFP_ATOMIC); if (skb) { if (pskb_trim_rcsum(skb, len)) return skb; -- 2.30.2