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] [day] [month] [year] [list]
Message-ID: <c71ed92e-b4de-2fbc-28c8-7afbc474049f@gmail.com>
Date:   Wed, 8 Feb 2017 08:39:53 -0800
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Andrew Lunn <andrew@...n.ch>, Fabio Estevam <festevam@...il.com>
Cc:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Nikita Yushchenko <nikita.yoush@...entembedded.com>
Subject: Re: Kernel crashes in phy_attach_direct()



On 02/08/2017 06:51 AM, Andrew Lunn wrote:
>> 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.

I sent a fix for that last night:

https://patchwork.ozlabs.org/patch/725522/

Sorry about that!
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ