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:   Tue, 11 Sep 2018 11:23:18 -0700
From:   Vasiliy Khoruzhick <vasilykh@...sta.com>
To:     Stephen Hemminger <stephen@...workplumber.org>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Roopa Prabhu <roopa@...ulusnetworks.com>,
        Alexey Dobriyan <adobriyan@...il.com>,
        Eric Dumazet <edumazet@...gle.com>,
        Jim Westfall <jwestfall@...realistic.net>,
        Wolfgang Bumiller <w.bumiller@...xmox.com>,
        Vasily Khoruzhick <anarsoul@...il.com>,
        Kees Cook <keescook@...omium.org>,
        Ihar Hrachyshka <ihrachys@...hat.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] neighbour: confirm neigh entries when ARP packet is received

On Tue, Sep 11, 2018 at 11:12 AM, Stephen Hemminger
<stephen@...workplumber.org> wrote:
> On Tue, 11 Sep 2018 11:04:06 -0700
> Vasily Khoruzhick <vasilykh@...sta.com> wrote:
>
>> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
>> index aa19d86937af..56a554597db5 100644
>> --- a/net/core/neighbour.c
>> +++ b/net/core/neighbour.c
>> @@ -1180,6 +1180,12 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
>>               lladdr = neigh->ha;
>>       }
>>
>> +     /* Update confirmed timestamp for neighbour entry after we
>> +      * received ARP packet even if it doesn't change IP to MAC binding.
>> +      */
>> +     if (new & NUD_CONNECTED)
>> +             neigh->confirmed = jiffies;
>
> You might want to do:
>         if ((new & NUD_CONNECTED) && neigh->confirmed != jiffies)
>                 neigh->confirmed = jiffies;
>
> This avoid poisoning the cacheline with unnecessary write.

Sorry for duplicate - this time in plain text, so it should get
through lkml filter:

I don't think that it's performance-critical path, so this
optimization is unnecessary
and it doesn't improve code readability.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ