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]
Date:   Wed, 8 Feb 2017 15:51:48 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Fabio Estevam <festevam@...il.com>
Cc:     Florian Fainelli <f.fainelli@...il.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: Kernel crashes in phy_attach_direct()

> Yes, this is what I am using right now:
> 
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -920,11 +920,6 @@ int phy_attach_direct(struct net_device *dev,
> struct phy_device *phydev,
>                 return -EIO;
>         }
> 
> -       if (!try_module_get(d->driver->owner)) {
> -               dev_err(&dev->dev, "failed to get the device driver module\n");
> -               return -EIO;
> -       }
> -
>         get_device(d);
> 
>         /* Assume that if there is no driver, that it doesn't
> @@ -946,6 +941,11 @@ int phy_attach_direct(struct net_device *dev,
> struct phy_device *phydev,
>                         goto error;
>         }
> 
> +       if (!try_module_get(d->driver->owner)) {
> +               dev_err(&dev->dev, "failed to get the device driver module\n");
> +               return -EIO;
> +       }
> +
>         if (phydev->attached_dev) {
>                 dev_err(&dev->dev, "PHY already attached\n");
>                 err = -EBUSY;
> 
> Would you like me to submit this one?

I'm just wondering about the get_device(d); Does the ordering matter
here? Lets wait for Florian before submitting a patch.

      Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ