[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51C859CF.80009@redhat.com>
Date: Mon, 24 Jun 2013 16:38:07 +0200
From: Daniel Borkmann <dborkman@...hat.com>
To: Veaceslav Falico <vfalico@...hat.com>
CC: Eric Dumazet <eric.dumazet@...il.com>,
David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
Pravin B Shelar <pshelar@...ira.com>
Subject: Re: gre: fix a possible skb leak
On 06/24/2013 04:03 PM, Veaceslav Falico wrote:
> On Mon, Jun 24, 2013 at 06:26:00AM -0700, Eric Dumazet wrote:
>> From: Eric Dumazet <edumazet@...gle.com>
...
> Maybe we can also use it here (build-tested only):
Yep, this clean-up looks good I think. But then -net needs to be merged into
-net-next first (also for the gre_offload patch).
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 4850dc1..5776819 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -2924,10 +2924,7 @@ perform_csum_check:
> return segs;
>
> err:
> - while ((skb = segs)) {
> - segs = skb->next;
> - kfree_skb(skb);
> - }
> + kfree_skb_list(segs);
> return ERR_PTR(err);
> }
> EXPORT_SYMBOL_GPL(skb_segment);
> diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
> index 4bcabf3..27ba045 100644
> --- a/net/ipv4/ip_output.c
> +++ b/net/ipv4/ip_output.c
> @@ -575,11 +575,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
> return 0;
> }
>
> - while (frag) {
> - skb = frag->next;
> - kfree_skb(frag);
> - frag = skb;
> - }
> + kfree_skb_list(frag);
> IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS);
> return err;
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists