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-next>] [day] [month] [year] [list]
Message-ID: <562F9F06.7040402@gmail.com>
Date:	Tue, 27 Oct 2015 08:57:58 -0700
From:	Florian Fainelli <f.fainelli@...il.com>
To:	Frode Isaksen <fisaksen@...libre.com>
CC:	Neil Armstrong <narmstrong@...libre.com>,
	"David S. Miller" <davem@...emloft.net>,
	Andrew Lunn <andrew@...n.ch>,
	Guenter Roeck <linux@...ck-us.net>,
	vivien.didelot@...oirfairelinux.com,
	Fabian Frederick <fabf@...net.be>,
	Pavel Nakonechny <pavel.nakonechny@...tlab.ru>,
	Joe Perches <joe@...ches.com>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/6] net: phy: Stop 'phy-state-machine' and 'phy_change'
 work on remove

(don't top post please)

On 27/10/15 08:53, Frode Isaksen wrote:
> What will you need in the oops ? I presume you don' want everything or ?
> 
> The PHY state machine is not stopped with a PHY disconnect.

It is stopped with a phy_disconnect():

/**
 * phy_disconnect - disable interrupts, stop state machine, and detach a PHY
 *                  device
 * @phydev: target phy_device struct
 */
void phy_disconnect(struct phy_device *phydev)
{
        if (phydev->irq > 0)
                phy_stop_interrupts(phydev);

        phy_stop_machine(phydev);

        phydev->adjust_link = NULL;

        phy_detach(phydev);
}


> However, the
> 'phy-change' work is cancelled, so cancelling this work in the remove
> function maybe not needed. I will verify ASAP.
> 
> Frode
> 
> 2015-10-27 16:40 GMT+01:00 Florian Fainelli <f.fainelli@...il.com
> <mailto:f.fainelli@...il.com>>:
> 
>     On 27/10/15 07:49, Neil Armstrong wrote:
>     > Avoids:
>     >  Unable to handle kernel NULL pointer dereference at virtual address 00000064
>     >  Workqueue: events_power_efficient phy_state_machine
>     >  PC is at phy_state_machine+0x28/0x480
> 
>     Stripped down oops can sometimes be missing critical pieces of
>     information to help debug the problem, is there a reason why this is
>     being obfuscated?
> 
>     You are supposed to stop the PHY state machine by calling
>     phy_disconnect() is it possible that this is missing?
> 
>     >
>     > Signed-off-by: Frode Isaksen <fisaksen@...libre.com
>     <mailto:fisaksen@...libre.com>>
>     > Signed-off-by: Neil Armstrong <narmstrong@...libre.com
>     <mailto:narmstrong@...libre.com>>
>     > ---
>     >  drivers/net/phy/phy_device.c | 6 ++++++
>     >  1 file changed, 6 insertions(+)
>     >
>     > diff --git a/drivers/net/phy/phy_device.c
>     b/drivers/net/phy/phy_device.c
>     > index 3833891..b5b6c1b 100644
>     > --- a/drivers/net/phy/phy_device.c
>     > +++ b/drivers/net/phy/phy_device.c
>     > @@ -1348,6 +1348,12 @@ static int phy_remove(struct device *dev)
>     >       phydev->state = PHY_DOWN;
>     >       mutex_unlock(&phydev->lock);
>     >
>     > +     cancel_delayed_work_sync(&phydev->state_queue);
>     > +     flush_delayed_work(&phydev->state_queue);
>     > +
>     > +     cancel_work_sync(&phydev->phy_queue);
>     > +     flush_work(&phydev->phy_queue);
>     > +
>     >       if (phydev->drv->remove)
>     >               phydev->drv->remove(phydev);
>     >       phydev->drv = NULL;
>     >
> 
> 
>     --
>     Florian
> 
> 


-- 
Florian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ