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] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 07 Jul 2008 22:45:52 +0800
From:	Wang Chen <wangchen@...fujitsu.com>
To:	Patrick McHardy <kaber@...sh.net>
CC:	"David S. Miller" <davem@...emloft.net>,
	NETDEV <netdev@...r.kernel.org>,
	YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
Subject: Re: v3 [PATCH net-next 4/7] ipv6: Check return of dev_set_allmulti

Patrick McHardy said the following on 2008-7-7 21:26:
> Wang Chen wrote:
>> Patrick McHardy said the following on 2008-7-7 19:20:
>>>> @@ -627,13 +633,14 @@ static int mif6_add(struct mif6ctl *vifc, int
>>>> mrtsock)
>>>>          if (!dev)
>>>>              return -EADDRNOTAVAIL;
>>>>          dev_put(dev);
>>>> +        err = dev_set_allmulti(dev, 1);
>>>> +        if (err)
>>>> +            return err;
>>> The use of dev after putting it looks wrong, but thats already
>>> present before your patch. So ACK for your patch, but we need
>>> a fix on top.
>>>
>>
>> Wait a moment :)
>> ---
>>     case 0:
>>         dev = dev_get_by_index(&init_net, vifc->mif6c_pifi);
>>         if (!dev)
>>             return -EADDRNOTAVAIL;
>>         dev_put(dev);
>> ---
>> dev_get_by_index() holds the dev, so I think dev_put() just for hold/put
>> balance.
> 
> Sure, but its used after dropping the reference again.

If so, my patch wrong.
Because, 

>               dev = ip6mr_reg_vif();
>               if (!dev)
>                       return -ENOBUFS;

here, needs dev_hold(dev) also.
so, I think I should fix it in this patch too, not a fix on top.
How do you think, Patrick?

> +               err = dev_set_allmulti(dev, 1);
> +               if (err) {
> +                       unregister_netdevice(dev);
> +                       return err;
> +               }
>               break;

--
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