All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [net] net: fix double free issue of skbuff
Date: Mon, 29 Feb 2016 14:10:11 +0100	[thread overview]
Message-ID: <1456751411.4837.25.camel@redhat.com> (raw)
In-Reply-To: <1456748573-21586-1-git-send-email-zhangshengju@cmss.chinamobile.com>

On Mon, 2016-02-29 at 12:22 +0000, Zhang Shengju wrote:
> If skb_reorder_vlan_header() failed, skb is freed and NULL is returned.
> Then at skb_vlan_untag(), it will free skbuff again which cause double
> free.

On skb_reorder_vlan_header() failure, skb_vlan_untag() will call
kfree_skb() using the return value of skb_reorder_vlan_header(), that is
NULL. kfree_skb() is a noop when the argument is NULL.

The current code seams safe.

Paolo

  parent reply	other threads:[~2016-02-29 13:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29 12:22 [net] net: fix double free issue of skbuff Zhang Shengju
2016-02-29 12:58 ` Sergei Shtylyov
2016-02-29 13:10 ` Paolo Abeni [this message]
2016-02-29 17:01 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2016-02-29 14:10 张胜举
2016-02-29 14:16 张胜举
2016-02-29 17:11 ` 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=1456751411.4837.25.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=zhangshengju@cmss.chinamobile.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.