David Miller wrote:
> From: Florian Westphal
> 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)
From: Florian Westphal
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);
>
Device alias can be set by either rtnetlink (rtnl is held) or sysfs.
rtnetlink hold the rtnl mutex, sysfs acquires it for this purpose.
Add an extra mutex for it plus a seqcount to get a consistent snapshot
of the alias buffer.
This allows the sysfs path to not take rtnl and would later allow
to