Skip to content

Commit

Permalink
packet: Fix leak in pre-defrag support.
Browse files Browse the repository at this point in the history
When we clone the SKB, we forget about the original
one.  Avoid this problem by using skb_share_check().

Reported-by: Penttilä Mika <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Jul 6, 2011
1 parent dc7f9f6 commit aec2731
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aec2731

Please sign in to comment.