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]
Message-ID: <f62595d4-2dd7-9cc3-7537-2ff186dadc8c@gmail.com>
Date:   Tue, 6 Dec 2016 17:57:59 -0800
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Timur Tabi <timur@...eaurora.org>,
        David Miller <davem@...emloft.net>, jon.mason@...adcom.com,
        netdev@...r.kernel.org
Subject: Re: [PATCH] [v3] net: phy: phy drivers should not set
 SUPPORTED_[Asym_]Pause

On 12/06/2016 05:50 PM, Timur Tabi wrote:
> Florian Fainelli wrote:
>>> +    if (phydrv->features & (SUPPORTED_Pause | SUPPORTED_Asym_Pause)) {
>>> >+        phydev->supported &= ~(SUPPORTED_Pause |
>>> SUPPORTED_Asym_Pause);
>>> >+        phydev->supported |= phydrv->features &
>>> >+                     (SUPPORTED_Pause | SUPPORTED_Asym_Pause);
>> Is not the & (SUPPORTED_Pause | SUPPORTED_Asym_Pause) redundant here
>> anyway?
> 
> I'm just trying to be safe.  Can I be certain that those bits are
> already zero?

The bits are most likely not zero, since we have all the
PHY_GBIT_FEATURES bits defined in there as well, but I don't think that
is a real problem though, because we did this before:

        /* Start out supporting everything. Eventually,
         * a controller will attach, and may modify one
         * or both of these values
         */
        phydev->supported = phydrv->features;
        of_set_phy_supported(phydev);
        phydev->advertising = phydev->supported;

which is why this made me think the & (SUPPORTED_Pause |
SUPPPORTED_Asym_Pause) here is most likely redundant?

Thanks!
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ