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>] [day] [month] [year] [list]
Message-ID: <F54AEECA5E2B9541821D670476DAE19C5A917127@PGSMSX102.gar.corp.intel.com>
Date:   Thu, 29 Dec 2016 09:36:57 +0000
From:   "Kweh, Hock Leong" <hock.leong.kweh@...el.com>
To:     Florian Fainelli <f.fainelli@...il.com>,
        David Miller <davem@...emloft.net>
CC:     "Joao.Pinto@...opsys.com" <Joao.Pinto@...opsys.com>,
        "peppe.cavallaro@...com" <peppe.cavallaro@...com>,
        "seraphin.bonnaffe@...com" <seraphin.bonnaffe@...com>,
        "alexandre.torgue@...il.com" <alexandre.torgue@...il.com>,
        "manabian@...il.com" <manabian@...il.com>,
        "niklas.cassel@...s.com" <niklas.cassel@...s.com>,
        "johan@...nel.org" <johan@...nel.org>,
        "pavel@....cz" <pavel@....cz>,
        "Ong, Boon Leong" <boon.leong.ong@...el.com>,
        "Voon, Weifeng" <weifeng.voon@...el.com>,
        "lars.persson@...s.com" <lars.persson@...s.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Giuseppe Cavallaro <peppe.cavallaro@...com>,
        Alexandre Torgue <alexandre.torgue@...com>
Subject: RE: [PATCH net] net: stmmac: Fix error path after register_netdev
 move

> -----Original Message-----
> From: Florian Fainelli [mailto:f.fainelli@...il.com]
> Sent: Thursday, December 29, 2016 7:45 AM
> To: netdev@...r.kernel.org
> Cc: Florian Fainelli <f.fainelli@...il.com>; pavel@....cz;
> Joao.Pinto@...opsys.com; seraphin.bonnaffe@...com;
> alexandre.torgue@...il.com; manabian@...il.com; niklas.cassel@...s.com;
> johan@...nel.org; Ong, Boon Leong <boon.leong.ong@...el.com>; Voon,
> Weifeng <weifeng.voon@...el.com>; lars.persson@...s.com; linux-
> kernel@...r.kernel.org; Giuseppe Cavallaro <peppe.cavallaro@...com>;
> Alexandre Torgue <alexandre.torgue@...com>
> Subject: [PATCH net] net: stmmac: Fix error path after register_netdev move
> 
> Commit 5701659004d6 ("net: stmmac: Fix race between stmmac_drv_probe and
> stmmac_open") re-ordered how the MDIO bus registration and the network
> device are registered, but missed to unwind the MDIO bus registration in case
> we fail to register the network device.
> 
> Fixes: 5701659004d6 ("net: stmmac: Fix race between stmmac_drv_probe and
> stmmac_open")
> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> ---

Acked-by: Kweh, Hock Leong <hock.leong.kweh@...el.com>



>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 5910ea51f8f6..39eb7a65bb9f 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -3366,12 +3366,19 @@ int stmmac_dvr_probe(struct device *device,
>  	}
> 
>  	ret = register_netdev(ndev);
> -	if (ret)
> +	if (ret) {
>  		netdev_err(priv->dev, "%s: ERROR %i registering the device\n",
>  			   __func__, ret);
> +		goto error_netdev_register;
> +	}
> 
>  	return ret;
> 
> +error_netdev_register:
> +	if (priv->hw->pcs != STMMAC_PCS_RGMII &&
> +	    priv->hw->pcs != STMMAC_PCS_TBI &&
> +	    priv->hw->pcs != STMMAC_PCS_RTBI)
> +		stmmac_mdio_unregister(ndev);
>  error_mdio_register:
>  	netif_napi_del(&priv->napi);
>  error_hw_init:
> --
> 2.9.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ