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,  5 Mar 2024 14:24:20 +0800
From: linke li <lilinke99@...com>
To: joel@...lfernandes.org
Cc: boqun.feng@...il.com,
	dave@...olabs.net,
	frederic@...nel.org,
	jiangshanlai@...il.com,
	josh@...htriplett.org,
	lilinke99@...com,
	linux-kernel@...r.kernel.org,
	mathieu.desnoyers@...icios.com,
	paulmck@...nel.org,
	qiang.zhang1211@...il.com,
	quic_neeraju@...cinc.com,
	rcu@...r.kernel.org,
	rostedt@...dmis.org
Subject: Re: [PATCH] rcutorture: Fix rcu_torture_pipe_update_one()/rcu_torture_writer() data race and concurrency bug

> Anyway, a slightly related/different question:
> 
> Should that:
> WRITE_ONCE(rp->rtort_pipe_count, rp->rtort_pipe_count + 1);
> 
> Be:
> WRITE_ONCE(rp->rtort_pipe_count, READ_ONCE(rp->rtort_pipe_count) + 1);
> 
> ?

Hi, Joel. Sorry, I am not very sure about this. I do a little research on
it.

I looked through all code in kernel that looks like this, both kinds are
used. I also try to compile this file with and without the READ_ONCE in
WRITE_ONCE using gcc-9. Their binary is just the same. 

Thus I think in the current compiler version, they do not have a big
difference, but if the compiler wants to optimize more, maybe the latter
one is better.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ