From: Florian Fainelli <f.fainelli@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, hkallweit1@gmail.com, kuba@kernel.org,
davem@davemloft.net
Subject: Re: [PATCH net 1/2] net: phy: Avoid NPD upon phy_detach() when driver is unbound
Date: Thu, 17 Sep 2020 09:32:03 -0700 [thread overview]
Message-ID: <b33da0da-4c6a-ae11-b77e-93d014a90123@gmail.com> (raw)
In-Reply-To: <20200917131545.GL3526428@lunn.ch>
On 9/17/2020 6:15 AM, Andrew Lunn wrote:
> On Wed, Sep 16, 2020 at 08:43:09PM -0700, Florian Fainelli wrote:
>> If we have unbound the PHY driver prior to calling phy_detach() (often
>> via phy_disconnect()) then we can cause a NULL pointer de-reference
>> accessing the driver owner member. The steps to reproduce are:
>>
>> echo unimac-mdio-0:01 > /sys/class/net/eth0/phydev/driver/unbind
>> ip link set eth0 down
>
> Hi Florian
>
> How forceful is this unbind? Can we actually block it while the
> interface is up? Or returning -EBUSY would make sense.
It it not forceful, you can unbind the PHY driver from underneath the
net_device and nothing bad happens, really. This is not a very realistic
or practical use case, but several years ago, I went into making sure we
would not create NPD if that happened.
--
Florian
next prev parent reply other threads:[~2020-09-17 16:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-17 3:43 [PATCH net 0/2] net: phy: Unbind fixes Florian Fainelli
2020-09-17 3:43 ` [PATCH net 1/2] net: phy: Avoid NPD upon phy_detach() when driver is unbound Florian Fainelli
2020-09-17 13:15 ` Andrew Lunn
2020-09-17 16:32 ` Florian Fainelli [this message]
2020-09-17 17:28 ` Andrew Lunn
2020-09-17 3:43 ` [PATCH net 2/2] net: phy: Do not warn in phy_stop() on PHY_DOWN Florian Fainelli
2020-09-17 13:16 ` Andrew Lunn
2020-09-17 23:56 ` [PATCH net 0/2] net: phy: Unbind fixes David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b33da0da-4c6a-ae11-b77e-93d014a90123@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.