aboutsummaryrefslogtreecommitdiffstats
path: root/net/packet
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-07-06 10:30:59 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-06 10:30:59 -0400
commitaec27311c23a8ce8eaf490762249d3ed74be83b6 (patch)
tree51a789724f43439d5aff9ddc4d87cd4d00397489 /net/packet
parentdc7f9f6e8838556f226c2ebd1da7bb305cb25654 (diff)
packet: Fix leak in pre-defrag support.
When we clone the SKB, we forget about the original one. Avoid this problem by using skb_share_check(). Reported-by: Penttilä Mika <mika.penttila@ixonos.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet')
-rw-r--r--net/packet/af_packet.c2
1 files changed, 1 insertions, 1 deletions
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)
476 return skb; 476 return skb;
477 477
478 if (ip_is_fragment(ip_hdr(skb))) { 478 if (ip_is_fragment(ip_hdr(skb))) {
479 skb = skb_clone(skb, GFP_ATOMIC); 479 skb = skb_share_check(skb, GFP_ATOMIC);
480 if (skb) { 480 if (skb) {
481 if (pskb_trim_rcsum(skb, len)) 481 if (pskb_trim_rcsum(skb, len))
482 return skb; 482 return skb;