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: <20150108152230.GL5280@linux.vnet.ibm.com>
Date:	Thu, 8 Jan 2015 07:22:30 -0800
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	linux-kernel@...r.kernel.org, mingo@...nel.org,
	laijs@...fujitsu.com, dipankar@...ibm.com,
	akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
	josh@...htriplett.org, tglx@...utronix.de, rostedt@...dmis.org,
	dhowells@...hat.com, edumazet@...gle.com, dvhart@...ux.intel.com,
	fweisbec@...il.com, oleg@...hat.com, bobby.prani@...il.com
Subject: Re: [PATCH tip/core/rcu 01/14] rcu: Protect rcu_boost() lockless
 accesses with ACCESS_ONCE()

On Thu, Jan 08, 2015 at 10:41:02AM +0100, Peter Zijlstra wrote:
> On Wed, Jan 07, 2015 at 09:32:20AM -0800, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
> > 
> > This commit prevents random compiler optimizations by applying
> > ACCESS_ONCE() to lockless accesses.
> > 
> > Signed-off-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
> > ---
> >  kernel/rcu/tree_plugin.h | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
> > index 3ec85cb5d544..d59913ef8360 100644
> > --- a/kernel/rcu/tree_plugin.h
> > +++ b/kernel/rcu/tree_plugin.h
> > @@ -1127,7 +1127,8 @@ static int rcu_boost(struct rcu_node *rnp)
> >  	struct task_struct *t;
> >  	struct list_head *tb;
> >  
> > -	if (rnp->exp_tasks == NULL && rnp->boost_tasks == NULL)
> > +	if (ACCESS_ONCE(rnp->exp_tasks) == NULL &&
> > +	    ACCESS_ONCE(rnp->boost_tasks) == NULL)
> >  		return 0;  /* Nothing left to boost. */
> 
> Didn't we just obsolete ACCESS_ONCE with that {READ,WRITE}_ONCE stuff?

Indeed we did!  But that was after I did this commit back on October 29th.

I am planning a bulk change to READ_ONCE() and ASSIGN_ONCE() either as
the last patch for 3.20 or as the first one for 3.21.  Probably as the
first for 3.21 to minimize rebasing hassles with any needed 3.20 fixes.

							Thanx, Paul

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ