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]
Message-ID: <20171002092257.GA30423@breakpoint.cc>
Date:   Mon, 2 Oct 2017 11:22:57 +0200
From:   Florian Westphal <fw@...len.de>
To:     David Miller <davem@...emloft.net>
Cc:     fw@...len.de, netdev@...r.kernel.org, edumazet@...gle.com
Subject: Re: [PATCH net-next] net: core: decouple ifalias get/set from rtnl
 lock

David Miller <davem@...emloft.net> wrote:
> From: Florian Westphal <fw@...len.de>
> Date: Fri, 29 Sep 2017 13:21:50 +0200
> 
> > @@ -1488,7 +1484,7 @@ static void netdev_release(struct device *d)
> >  
> >  	BUG_ON(dev->reg_state != NETREG_RELEASED);
> >  
> > -	kfree(dev->ifalias);
> > +	kfree(rcu_access_pointer(dev->ifalias));
> >  	netdev_freemem(dev);
> >  }
> >  
> 
> "kfree_rcu()" at least?
> 
> If the deal is that you don't need to do and RCU free because
> netdevice objects disappear synchronously, and you can therefore prove
> that no RCU based async access can occur to dev->ifalias, then you
> need to add a comment here.

Ok, I will add a comment.

netdev_release gets called via kobject_put() if this was last reference
to the device. At that point the device has already been removed from
all lists (and private destructor was invoked too).

Also, netdev_freemem frees the net_device memory immediately
so no other cpu is allowed to use dev at this point.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ