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: <CAHp75Ve_mokaJwSf2Qpd9mSvpKuBkJXyCC133zqEz5ujhXDncg@mail.gmail.com>
Date:   Mon, 25 Jun 2018 12:49:49 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Joe Perches <joe@...ches.com>
Cc:     Michael Straube <michael.straube@...teo.de>,
        Dan Carpenter <dan.carpenter@...cle.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        devel@...verdev.osuosl.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging: rtl8723bs: do not use assignment in if condition

On Fri, Jun 22, 2018 at 8:28 PM, Joe Perches <joe@...ches.com> wrote:
> On Fri, 2018-06-22 at 14:48 +0200, Michael Straube wrote:
>> On 06/22/18 12:57, Dan Carpenter wrote:

> Output from checkpatch is not gospel and can be ignored
> whenever appropriate.
>
> I think the below is ok:
>
>         if ((is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) &&
>             ((addr = of_get_property(np, "local-mac-address", &len)) &&
>              len == ETH_ALEN))
>                 memcpy(mac_addr, addr, ETH_ALEN);
>         else
>                 memcpy(mac_addr, ""\x00\xe0\x4c\x87\x00\x00", ETH_ALEN);
>
> Although the last memcpy of a fixed mac address could
> probably use eth_random_addr to reduce the likelihood
> of mac address collision

...and first one looks like ether_addr_copy().

> so maybe
>
>         if ((is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) &&
>             ((addr = of_get_property(np, "local-mac-address", &len)) &&
>
>      len == ETH_ALEN))
>                 memcpy(mac_addr, addr, ETH_ALEN);
>         else
>                 eth_random_addr(mac_addr);
>
>> If yes, I'm not sure how to proceed as these are the very first patches I send.
>> Should I send a v2 patch with both changes or just a v2 with "np" removed and
>> another one for adding 'is_broadcast_ether_addr' and 'is_zero_ether_addr' checks?



-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ