[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56D4406D.5060303@cogentembedded.com>
Date: Mon, 29 Feb 2016 15:58:21 +0300
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: Zhang Shengju <zhangshengju@...s.chinamobile.com>,
davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [net] net: fix double free issue of skbuff
Hello.
On 2/29/2016 3:22 PM, 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.
>
> This patch removes kfree_skb() call in function skb_reorder_vlan_header().
>
> Signed-off-by: Zhang Shengju <zhangshengju@...s.chinamobile.com>
> ---
> net/core/skbuff.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 488566b..1312d4b 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -4350,7 +4350,6 @@ EXPORT_SYMBOL_GPL(skb_gso_transport_seglen);
> static struct sk_buff *skb_reorder_vlan_header(struct sk_buff *skb)
> {
> if (skb_cow(skb, skb_headroom(skb)) < 0) {
> - kfree_skb(skb);
> return NULL;
> }
You now need to remove {}.
MBR, Sergei
Powered by blists - more mailing lists