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: <b4818488-a315-43bf-86bc-85cd6b854f0a@blackwall.org>
Date: Fri, 31 May 2024 00:34:41 +0300
From: Nikolay Aleksandrov <razor@...ckwall.org>
To: Petr Machata <petrm@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
 Ido Schimmel <idosch@...dia.com>, David Ahern <dsahern@...nel.org>
Subject: Re: [PATCH net-next 0/4] Allow configuration of multipath hash seed

On 5/30/24 21:07, Nikolay Aleksandrov wrote:
> On 5/30/24 20:27, Nikolay Aleksandrov wrote:
>> On 5/30/24 18:25, Petr Machata wrote:
>>>
>>> Nikolay Aleksandrov <razor@...ckwall.org> writes:
>>>
>>
> [snip]
[snip snip]
>>>
>>> I kept the RCU stuff in because it makes it easy to precompute the
>>> siphash key while allowing readers to access it lock-free. I could
>>> inline it and guard with a seqlock instead, but that's a bit messier
>>> code-wise. Or indeed construct in-situ, it's an atomic access plus like
>>> four instructions or something like that.
>>
>> You can READ/WRITE_ONCE() the full 8 bytes every time so it's lock-free
>> and consistent view of both values for observers. For fast-path it'll
>> only be accessing one of the two values, so it's fine either way. You
>> can use barriers to ensure latest value is seen by interested readers,
>> but for most eventual consistency would be enough.
>>
> 
> Actually aren't we interested only in user_seed in the external reader
> case? We don't care what's in mp_seed, so this is much simpler.
> 

Oh, I misunderstood you, didn't I? :) Were you talking about
constructing the siphash key in the fast-path above? If yes,
then sure it's a few instructions but nothing conditional.
I don't think we need anything atomic in that case.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ