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: <20250516030000.48858-1-kuniyu@amazon.com>
Date: Thu, 15 May 2025 19:59:41 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <kuba@...nel.org>
CC: <andrew+netdev@...n.ch>, <davem@...emloft.net>, <edumazet@...gle.com>,
	<horms@...nel.org>, <kuniyu@...zon.com>, <netdev@...r.kernel.org>,
	<pabeni@...hat.com>, <sdf@...ichev.me>
Subject: Re: [PATCH net-next] net: let lockdep compare instance locks

From: Jakub Kicinski <kuba@...nel.org>
Date: Thu, 15 May 2025 19:36:09 -0700
> On Thu, 15 May 2025 18:49:07 -0700 Kuniyuki Iwashima wrote:
> > > +#ifdef CONFIG_DEBUG_NET_SMALL_RTNL
> > > +	/* It's okay to use per-netns rtnl_lock if devices share netns */
> > > +	if (net_eq(dev_net(dev_a), dev_net(dev_b)) &&
> > > +	    lockdep_rtnl_net_is_held(dev_net(dev_a)))  
> > 
> > Do we need
> > 
> >   !from_cleanup_net()
> > 
> > before lockdep_rtnl_net_is_held() ?
> > 
> > __rtnl_net_lock() is not held in ops_exit_rtnl_list() and
> > default_device_exit_batch() when calling unregister_netdevice_many().
> 
> Or do we need
> 
>   if (from_cleanup_net())
>   	return -1;
> 
> ?

Ah right, otherwise we'll return 1 for cleanup_net() :)


> Is the thinking that once the big rtnl lock disappears in cleanup_net
> the devices are safe to destroy without any locking because there can't
> be any live users trying to access them?

I hope yes, but removing VF via sysfs and removing netns might
race and need some locking ?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ