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: Sat, 5 Aug 2023 10:10:07 +0200
From: Simon Horman <horms@...nel.org>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: Simon Horman <horms@...nel.org>, netdev@...r.kernel.org,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Andrew Lunn <andrew@...n.ch>,
	Florian Fainelli <f.fainelli@...il.com>,
	Claudiu Manoil <claudiu.manoil@....com>,
	Alexandre Belloni <alexandre.belloni@...tlin.com>,
	UNGLinuxDriver@...rochip.com,
	Colin Foster <colin.foster@...advantage.com>
Subject: Re: [PATCH net] net: dsa: ocelot: call dsa_tag_8021q_unregister()
 under rtnl_lock() on driver remove

On Fri, Aug 04, 2023 at 02:10:45PM +0300, Vladimir Oltean wrote:
> On Thu, Aug 03, 2023 at 09:29:38PM +0200, Simon Horman wrote:
> > On Thu, Aug 03, 2023 at 04:42:53PM +0300, Vladimir Oltean wrote:
> > > diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
> > > index fd7eb4a52918..9a3e5ec16972 100644
> > > --- a/drivers/net/dsa/ocelot/felix.c
> > > +++ b/drivers/net/dsa/ocelot/felix.c
> > > @@ -1619,8 +1619,10 @@ static void felix_teardown(struct dsa_switch *ds)
> > >  	struct felix *felix = ocelot_to_felix(ocelot);
> > >  	struct dsa_port *dp;
> > >  
> > > +	rtnl_lock();
> > >  	if (felix->tag_proto_ops)
> > >  		felix->tag_proto_ops->teardown(ds);
> > > +	rtnl_unlock();
> > 
> > Hi Vladimir,
> > 
> > I am curious to know if RTNL could be taken in
> > felix_tag_8021q_teardown() instead.
> 
> Negative. This call path also exists:
> 
> dsa_tree_change_tag_proto()
> -> rtnl_trylock()
> -> dsa_tree_notify(dst, DSA_NOTIFIER_TAG_PROTO, &info)
>    -> dsa_switch_change_tag_proto()
>       -> ds->ops->change_tag_protocol()
>          -> felix_change_tag_protocol()
>             -> old_proto_ops->teardown()
>                -> felix_tag_8021q_teardown()
> 
> where the rtnl_mutex is already held.

Ack. Thanks for confirming.
In that case this looks good to me.

Reviewed-by: Simon Horman <horms@...nel.org>






Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ