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