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: <c115a484-7aa5-cfe6-d26a-89efee3ee3fe@microchip.com>
Date:   Tue, 26 Oct 2021 18:32:37 +0200
From:   Nicolas Ferre <nicolas.ferre@...rochip.com>
To:     Jakub Kicinski <kuba@...nel.org>,
        Sean Anderson <sean.anderson@...o.com>
CC:     <netdev@...r.kernel.org>, "David S . Miller" <davem@...emloft.net>,
        Claudiu Beznea <claudiu.beznea@...rochip.com>,
        Antoine Tenart <atenart@...nel.org>,
        Russell King <linux@...linux.org.uk>
Subject: Re: [PATCH v4] net: macb: Fix several edge cases in validate

On 26/10/2021 at 17:39, Jakub Kicinski wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On Tue, 26 Oct 2021 11:30:08 -0400 Sean Anderson wrote:
>> Hi Jakub,
>>
>> On 10/25/21 8:44 PM, Jakub Kicinski wrote:
>>> On Mon, 25 Oct 2021 13:24:05 -0400 Sean Anderson wrote:
>>>> There were several cases where validate() would return bogus supported
>>>> modes with unusual combinations of interfaces and capabilities. For
>>>> example, if state->interface was 10GBASER and the macb had HIGH_SPEED
>>>> and PCS but not GIGABIT MODE, then 10/100 modes would be set anyway. In
>>>> another case, SGMII could be enabled even if the mac was not a GEM
>>>> (despite this being checked for later on in mac_config()). These
>>>> inconsistencies make it difficult to refactor this function cleanly.
>>>
>>> Since you're respinning anyway (AFAIU) would you mind clarifying
>>> the fix vs refactoring question? Sounds like it could be a fix for
>>> the right (wrong?) PHY/MAC combination, but I don't think you're
>>> intending it to be treated as a fix.
>>>
>>> If it's a fix it needs [PATCH net] in the subject and a Fixes tag,
>>> if it's not a fix it needs [PATCH net-next] in the subject.
>>>
>>> This will make the lifes of maintainers and backporters easier,
>>> thanks :)
>>
>> I don't know if it's a "fix" per se. The current logic isn't wrong,
>> since I believe that the configurations where the above patch would make
>> a difference do not exist. However, as noted in the commit message, this
>> makes refactoring difficult.
> 
> Ok, unless one of the PHY experts can help us make a call let's go
> for net-next and no Fixes tag.

Agreed.

Regards,
   Nicolas

>> For example, one might want to implement supported_interfaces like
>>
>>          if (bp->caps & MACB_CAPS_HIGH_SPEED &&
>>              bp->caps & MACB_CAPS_PCS)
>>                  __set_bit(PHY_INTERFACE_MODE_10GBASER, supported);
>>          if (macb_is_gem(bp) && bp->caps & MACB_CAPS_GIGABIT_MODE_AVAILABLE) {
>>                  __set_bit(PHY_INTERFACE_MODE_GMII, supported);
>>                phy_interface_set_rgmii(supported);
>>                  if (bp->caps & MACB_CAPS_PCS)
>>                          __set_bit(PHY_INTERFACE_MODE_SGMII, supported);
>>          }
>>          __set_bit(PHY_INTERFACE_MODE_MII, supported);
>>          __set_bit(PHY_INTERFACE_MODE_RMII, supported);
>>
>> but then you still need to check for GIGABIT_MODE in validate to
>> determine whether 10GBASER should "support" 10/100. See [1] for more
>> discussion.
>>
>> If you think this fixes a bug, then the appropriate tag is
>>
>> Fixes: 7897b071ac3b ("net: macb: convert to phylink")
>>
>> --Sean
>>
>> [1] https://lore.kernel.org/netdev/YXaIWFB8Kx9rm%2Fj9@shell.armlinux.org.uk/
> 


-- 
Nicolas Ferre

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ