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: <20250416022059.40422-1-kuniyu@amazon.com>
Date: Tue, 15 Apr 2025 19:20:27 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <kuniyu@...zon.com>
CC: <andrew+netdev@...n.ch>, <davem@...emloft.net>, <edumazet@...gle.com>,
	<horms@...nel.org>, <kuba@...nel.org>, <kuni1840@...il.com>,
	<netdev@...r.kernel.org>, <pabeni@...hat.com>
Subject: Re: [PATCH v1 net-next 3/3] ppp: Split ppp_exit_net() to ->exit_rtnl().

From: Kuniyuki Iwashima <kuniyu@...zon.com>
Date: Mon, 14 Apr 2025 19:22:01 -0700
> ppp_exit_net() unregisters devices related to the netns under
> RTNL and destroys lists and IDR.
> 
> Let's use ->exit_rtnl() for the device unregistration part to
> save RTNL dances for each netns.
> 
> Note that we delegate the for_each_netdev_safe() part to
> default_device_exit_batch() and replace unregister_netdevice_queue()
> with ppp_nl_dellink() to align with bond, geneve, gtp, and pfcp.
> 
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.com>
> ---
>  drivers/net/ppp/ppp_generic.c | 23 ++++++++---------------
>  1 file changed, 8 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
> index 53463767cc43..8cc293e5a585 100644
> --- a/drivers/net/ppp/ppp_generic.c
> +++ b/drivers/net/ppp/ppp_generic.c
> @@ -1146,28 +1146,20 @@ static __net_init int ppp_init_net(struct net *net)
>  	return 0;
>  }
>  
> -static __net_exit void ppp_exit_net(struct net *net)
> +static __net_exit void ppp_exit_rtnl_net(struct net *net,
> +					 struct list_head *dev_to_kill)
>  {
>  	struct ppp_net *pn = net_generic(net, ppp_net_id);
> -	struct net_device *dev;
> -	struct net_device *aux;
>  	struct ppp *ppp;
> -	LIST_HEAD(list);
>  	int id;
>  
> -	rtnl_lock();
> -	for_each_netdev_safe(net, dev, aux) {
> -		if (dev->netdev_ops == &ppp_netdev_ops)
> -			unregister_netdevice_queue(dev, &list);
> -	}
> -
>  	idr_for_each_entry(&pn->units_idr, ppp, id)
> -		/* Skip devices already unregistered by previous loop */
> -		if (!net_eq(dev_net(ppp->dev), net))
> -			unregister_netdevice_queue(ppp->dev, &list);
> +		ppp_nl_dellink(ppp->dev, dev_to_kill);

Sorry, this line broke the build, will fix in v2.

pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ