lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 28 Oct 2014 14:53:24 -0400 (EDT)
From:	David Miller <davem@...emloft.net>
To:	pshelar@...ira.com
Cc:	azhou@...ira.com, netdev@...r.kernel.org
Subject: Re: [net v2] iptunnel: Fix iptunnel_xmit return code for stats
 maintenance

From: Pravin Shelar <pshelar@...ira.com>
Date: Fri, 24 Oct 2014 14:41:20 -0700

> On Thu, Oct 23, 2014 at 10:10 PM, Andy Zhou <azhou@...ira.com> wrote:
>> @@ -1636,13 +1638,15 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,
>>         /* Need space for new headers (invalidates iph ptr) */
>>         err = skb_cow_head(skb, min_headroom);
>>         if (unlikely(err))
>> -               return err;
>> +               goto error;
>>
>>         if (vlan_tx_tag_present(skb)) {
>>                 if (WARN_ON(!__vlan_put_tag(skb,
>>                                             skb->vlan_proto,
>> -                                           vlan_tx_tag_get(skb))))
>> -                       return -ENOMEM;
>> +                                           vlan_tx_tag_get(skb)))) {
>> +                       err = -ENOMEM;
>> +                       goto error;
>> +               }
>>
> I just noticed that __vlan_put_tag() frees skb in case of error, so
> goto results in double free.
> maybe it is time we improve __vlan_put_tag() API, so that it is easier to use.

Agreed, and this would not be the first time we have been burnt by these
semantics.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ