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: <20161018122909.GR26778@lunn.ch>
Date:   Tue, 18 Oct 2016 14:29:09 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     John Crispin <john@...ozen.org>
Cc:     Vivien Didelot <vivien.didelot@...oirfairelinux.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: dsa: properly disconnect the slave PHYs

On Tue, Oct 18, 2016 at 02:12:40PM +0200, John Crispin wrote:
> The shutdown code only stopped the PHYs but does not diconnect them
> properly. This could lead to null pointer deref related kernel oopses
> during reboot. Fix this by calling phy_disconnect() after the PHYs are
> stopped.

Humm, i don't follow this.

The phy is disconnected in dsa_slave_destroy(). Why is that not
sufficient?

Also, after calling dsa_slave_close(), dsa_slave_open() can be
called. But with your change, the phy has gone, so we are going to
have trouble.

	Andrew

> 
> Signed-off-by: John Crispin <john@...ozen.org>
> ---
>  net/dsa/slave.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> index 68714a5..725d9f7 100644
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
> @@ -154,8 +154,10 @@ static int dsa_slave_close(struct net_device *dev)
>  	struct net_device *master = p->parent->dst->master_netdev;
>  	struct dsa_switch *ds = p->parent;
>  
> -	if (p->phy)
> +	if (p->phy) {
>  		phy_stop(p->phy);
> +		phy_disconnect(p->phy);
> +	}
>  
>  	dev_mc_unsync(master, dev);
>  	dev_uc_unsync(master, dev);
> -- 
> 1.7.10.4
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ