From: David Miller <davem@davemloft.net>
To: zhangshengju@cmss.chinamobile.com
Cc: pabeni@redhat.com, netdev@vger.kernel.org
Subject: Re: [net] net: fix double free issue of skbuff
Date: Mon, 29 Feb 2016 12:11:53 -0500 (EST) [thread overview]
Message-ID: <20160229.121153.1765066549122216101.davem@davemloft.net> (raw)
In-Reply-To: <001c01d172fb$cddc7530$69955f90$@cmss.chinamobile.com>
From: 张胜举 <zhangshengju@cmss.chinamobile.com>
Date: Mon, 29 Feb 2016 22:16:37 +0800
>> 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
> Hi Paolo, even current code is safe, this's still a potential problem. We should make an
> assumption that inner function doesn't free skb, and let outside function take care of this.
No, the current code is intentional and perfectly fine.
Fix real bugs, not imaginary ones.
Thanks.
next prev parent reply other threads:[~2016-02-29 17:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-29 14:16 [net] net: fix double free issue of skbuff 张胜举
2016-02-29 17:11 ` David Miller [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-02-29 14:10 张胜举
2016-02-29 12:22 Zhang Shengju
2016-02-29 12:58 ` Sergei Shtylyov
2016-02-29 13:10 ` Paolo Abeni
2016-02-29 17:01 ` 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=20160229.121153.1765066549122216101.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).