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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250331134811.02655264@kernel.org>
Date: Mon, 31 Mar 2025 13:48:11 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Stanislav Fomichev <sdf@...ichev.me>
Cc: 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 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

> +						 extack);
>  		if (err)
> -			goto errout;
> +			return err;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ