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] [day] [month] [year] [list]
Date:   Thu, 3 Mar 2022 16:07:49 +0200
From:   Vladimir Oltean <olteanv@...il.com>
To:     Vladimir Oltean <vladimir.oltean@....com>
Cc:     netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Florian Fainelli <f.fainelli@...il.com>,
        Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>
Subject: Re: [PATCH net-next] net: dsa: unlock the rtnl_mutex when
 dsa_master_setup() fails

On Thu, Mar 03, 2022 at 04:06:08PM +0200, Vladimir Oltean wrote:
> After the blamed commit, dsa_tree_setup_master() may exit without
> calling rtnl_unlock(), fix that.
> 
> Fixes: c146f9bc195a ("net: dsa: hold rtnl_mutex when calling dsa_master_{setup,teardown}")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
> ---
>  net/dsa/dsa2.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
> index 030d5f26715a..4655e81138dd 100644
> --- a/net/dsa/dsa2.c
> +++ b/net/dsa/dsa2.c
> @@ -1072,7 +1072,7 @@ static int dsa_tree_setup_switches(struct dsa_switch_tree *dst)
>  static int dsa_tree_setup_master(struct dsa_switch_tree *dst)
>  {
>  	struct dsa_port *dp;
> -	int err;
> +	int err = 0;
>  
>  	rtnl_lock();
>  
> @@ -1084,7 +1084,7 @@ static int dsa_tree_setup_master(struct dsa_switch_tree *dst)
>  
>  			err = dsa_master_setup(master, dp);
>  			if (err)
> -				return err;
> +				break;
>  
>  			/* Replay master state event */
>  			dsa_tree_master_admin_state_change(dst, master, admin_up);
> -- 
> 2.25.1
> 

Bad patch, please discard. Will send v2 right now.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ