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:   Thu, 20 Jul 2017 09:50:03 -0700
From:   Santosh Shilimkar <santosh.shilimkar@...cle.com>
To:     Håkon Bugge <Haakon.Bugge@...cle.com>
Cc:     "David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
        linux-rdma@...r.kernel.org, rds-devel@....oracle.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed

On 7/20/2017 3:28 AM, Håkon Bugge wrote:
> cp->cp_send_gen is treated as a normal variable, although it may be
> used by different threads.
> 
> This is fixed by using {READ,WRITE}_ONCE when it is incremented and
> READ_ONCE when it is read outside the {acquire,release}_in_xmit
> protection.
>
There is explicit memory barrier before the value is read outside
the {acquire,release}_in_xmit so it takes care of load/store sync.

> Normative reference from the Linux-Kernel Memory Model:
> 
>      Loads from and stores to shared (but non-atomic) variables should
>      be protected with the READ_ONCE(), WRITE_ONCE(), and
>      ACCESS_ONCE().
> 
> Clause 5.1.2.4/25 in the C standard is also relevant.
> 
> Signed-off-by: Håkon Bugge <haakon.bugge@...cle.com>
> Reviewed-by: Knut Omang <knut.omang@...cle.com>
> ---
Having said that, {READ,WRITE}_ONCE usages seems to make
it clear and explicit. So its fine with me.

Acked-by: Santosh Shilimkar <santosh.shilimkar@...cle.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ