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]
Message-ID: <b14f2b94b9ecfcb0926c09f8bce01dc2a52a0eca.camel@nvidia.com>
Date: Thu, 8 May 2025 18:24:39 +0000
From: Cosmin Ratiu <cratiu@...dia.com>
To: "stfomichev@...il.com" <stfomichev@...il.com>
CC: "davem@...emloft.net" <davem@...emloft.net>, "kuba@...nel.org"
	<kuba@...nel.org>, Tariq Toukan <tariqt@...dia.com>, Dragos Tatulea
	<dtatulea@...dia.com>, "sdf@...ichev.me" <sdf@...ichev.me>,
	"pabeni@...hat.com" <pabeni@...hat.com>, "horms@...nel.org"
	<horms@...nel.org>, "edumazet@...gle.com" <edumazet@...gle.com>, Saeed
 Mahameed <saeedm@...dia.com>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>
Subject: Re: [PATCH net v2] net: Lock lower level devices when updating
 features

On Thu, 2025-05-08 at 09:12 -0700, Stanislav Fomichev wrote:
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -10454,7 +10454,9 @@ static void
> > netdev_sync_lower_features(struct net_device *upper,
> >  			netdev_dbg(upper, "Disabling feature %pNF
> > on lower dev %s.\n",
> >  				   &feature, lower->name);
> >  			lower->wanted_features &= ~feature;
> > +			netdev_lock_ops(lower);
> >  			__netdev_update_features(lower);
> > +			netdev_unlock_ops(lower);
> >  
> >  			if (unlikely(lower->features & feature))
> >  				netdev_WARN(upper, "failed to
> > disable %pNF on %s!\n",
> 
> Any reason not to cover the whole section under the if()? For
> example,
> looking at netdev_features_change, most of its invocations are under
> the
> lock, so keeping the lock around it might help with consistency (and
> we can clarify it as such in
> Documentation/networking/netdevices.rst).
> Plus, wanted_features is already sort of ops-protected (looking at
> netif_disable_lro+dev_disable_lro).

The critical section could be extended for the whole if, but there are
a lot of netdev_features_change() calls in many drivers, which I am not
sure are ops protected. So I'd be reluctant to state that
NETDEV_FEAT_CHANGE is ops-protected in
Documentation/networking/netdevices.rst, even though all core
invocations would be made with the ops lock held.

I guess that's v3 coming soon then.

Cosmin.




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ