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: <Z-sFZfPR9QlDwhoI@mini-arch>
Date: Mon, 31 Mar 2025 14:13:09 -0700
From: Stanislav Fomichev <stfomichev@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Stanislav Fomichev <sdf@...ichev.me>, netdev@...r.kernel.org,
	davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
	Cosmin Ratiu <cratiu@...dia.com>
Subject: Re: [PATCH net v4 02/11] net: hold instance lock during
 NETDEV_REGISTER/UP

On 03/31, Jakub Kicinski wrote:
> On Mon, 31 Mar 2025 08:05:54 -0700 Stanislav Fomichev wrote:
> > Callers of inetdev_init can come from several places with inconsistent
> > expectation about netdev instance lock. Grab instance lock during
> > REGISTER (plus UP). Also solve the inconsistency with UNREGISTER
> > where it was locked only during move netns path.
> 
> Couple of nits, with that:
> 
> Reviewed-by: Jakub Kicinski <kuba@...nel.org>
> 
> > diff --git a/net/core/dev_api.c b/net/core/dev_api.c
> > index 8dbc60612100..cb3e5807dce8 100644
> > --- a/net/core/dev_api.c
> > +++ b/net/core/dev_api.c
> > @@ -119,9 +119,7 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net,
> >  {
> >  	int ret;
> >  
> > -	netdev_lock_ops(dev);
> > -	ret = netif_change_net_namespace(dev, net, pat, 0, NULL);
> > -	netdev_unlock_ops(dev);
> > +	ret = __dev_change_net_namespace(dev, net, pat, 0, NULL);
> >  
> >  	return ret;
> >  }
> 
> nit: no need for the temp variable for ret, now
> 
> > @@ -3042,14 +3040,16 @@ static int do_setlink(const struct sk_buff *skb, struct net_device *dev,
> >  
> >  		new_ifindex = nla_get_s32_default(tb[IFLA_NEW_IFINDEX], 0);
> >  
> > -		err = netif_change_net_namespace(dev, tgt_net, pat,
> > -						 new_ifindex, extack);
> > +		err = __dev_change_net_namespace(dev, tgt_net, pat, new_ifindex,
> 
> nit: over 80 chars now

It's exactly 80, is it considered over? This has been done by clang
formatter which has 'ColumnLimit: 80'.. Will undo regardless, but lmk
if the rule is >80 or >=80 (the formatter thinks it's the former)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ