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:	Thu, 06 Jun 2013 08:36:03 +0800
From:	Cong Wang <amwang@...hat.com>
To:	netdev@...r.kernel.org
Cc:	Eric Dumazet <eric.dumazet@...il.com>,
	Stephen Hemminger <stephen@...workplumber.org>,
	"David S. Miller" <davem@...emloft.net>
Subject: Re: [Patch net-next v2 3/3] igmp: convert RTNL lock to a spinlock

On Wed, 2013-06-05 at 17:38 +0800, Cong Wang wrote:
> -       while ((i = rtnl_dereference(in_dev->mc_list)) != NULL) {
> -               in_dev->mc_list = i->next_rcu;
> +       spin_lock(&ipv4_sk_mc_lock);
> +       while ((i = rcu_dereference_protected(in_dev->mc_list,
> +                       lockdep_is_held(&ipv4_sk_mc_lock))) != NULL) {
> +               rcu_assign_pointer(in_dev->mc_list, i->next_rcu);
>                 in_dev->mc_count--;
>  
>                 /* We've dropped the groups in ip_mc_down already */
>                 ip_mc_clear_src(i);
>                 ip_ma_put(i);
>         }
> +       spin_unlock(&ipv4_sk_mc_lock);
> +       synchronize_rcu(); 

Hmm, it seems this kind synchronize_rcu() is not needed, since we don't
free anything here, not very sure if it is okay that readers still have
the old value of ->mc_list... I think probably yes.


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