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, 5 May 2011 22:56:56 +0200
From:	Andi Kleen <andi@...stfloor.org>
To:	john stultz <johnstul@...ibm.com>
Cc:	Andi Kleen <andi@...stfloor.org>,
	lkml <linux-kernel@...r.kernel.org>,
	Paul Mackerras <paulus@...ba.org>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Anton Blanchard <anton@...ba.org>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] time: Add locking to xtime access in get_seconds()

On Thu, May 05, 2011 at 01:17:01PM -0700, john stultz wrote:
> On Thu, 2011-05-05 at 19:57 +0200, Andi Kleen wrote:
> > > I suspect the reason this hasn't been triggered on x86 or power6 is due
> > > to compiler or processor optimizations reordering the assignment to in
> > > effect make it atomic. Or maybe the timing window to see the issue is
> > > harder to observe?
> > 
> > On x86 all aligned stores are atomic. So I don't see how this 
> > could be a problem ever.
> 
> No no. The issue was with the fact that in update_xtime_cache we modify
> xtime_cache twice (once setting it possibly backwards to xtime, then
> adding in the nsec offset).

Ok makes sense. So the obvious fix is to compute the values first
in temporaries, then write them with appropiate wmb()s? 

For the reader it should not make any difference.

-Andi
--
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