From: Daniel Borkmann <dborkman@redhat.com>
To: Veaceslav Falico <vfalico@redhat.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Pravin B Shelar <pshelar@nicira.com>
Subject: Re: gre: fix a possible skb leak
Date: Mon, 24 Jun 2013 16:38:07 +0200 [thread overview]
Message-ID: <51C859CF.80009@redhat.com> (raw)
In-Reply-To: <20130624140359.GA28057@redhat.com>
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@google.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;
>
next prev parent reply other threads:[~2013-06-24 14:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 13:26 [PATCH] gre: fix a possible skb leak Eric Dumazet
2013-06-24 14:03 ` Veaceslav Falico
2013-06-24 14:36 ` Eric Dumazet
2013-06-24 14:39 ` Veaceslav Falico
2013-06-24 14:38 ` Daniel Borkmann [this message]
2013-06-25 23:08 ` [PATCH] " David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51C859CF.80009@redhat.com \
--to=dborkman@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pshelar@nicira.com \
--cc=vfalico@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.