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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1510161416050.4212@nanos>
Date:	Fri, 16 Oct 2015 14:19:29 +0200 (CEST)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Heiko Carstens <heiko.carstens@...ibm.com>
cc:	Stefan Liebler <stli@...ux.vnet.ibm.com>,
	Preeti U Murthy <preeti@...ux.vnet.ibm.com>,
	Peter Zijlstra <peterz@...radead.org>,
	linux-kernel@...r.kernel.org
Subject: Re: futex timeout not working? (bisected)



On Fri, 16 Oct 2015, Heiko Carstens wrote:

> On Fri, Oct 16, 2015 at 12:54:51PM +0200, Heiko Carstens wrote:
> > > > So you are saying this works on x86 and it must be some s390 specific bug?
> > > 
> > > Looks like. I have no idea why that would break on s390. Did you try
> > > to revert the commit on top of tree?
> > 
> > Reverting the patch isn't easy due to all the dependencies the code has in
> > the meantime. However the following code snippet does logically revert the
> > patch and it works again:
> > 
> > diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
> > index 3739ac6aa473..c97dd1cc9bd5 100644
> > --- a/kernel/time/timekeeping.c
> > +++ b/kernel/time/timekeeping.c
> > @@ -1953,12 +1953,10 @@ ktime_t ktime_get_update_offsets_now(unsigned int *cwsseq, ktime_t *offs_real,
> >  		nsecs = timekeeping_get_ns(&tk->tkr_mono);
> >  		base = ktime_add_ns(base, nsecs);
> >  
> > -		if (*cwsseq != tk->clock_was_set_seq) {
> > -			*cwsseq = tk->clock_was_set_seq;
> > -			*offs_real = tk->offs_real;
> > -			*offs_boot = tk->offs_boot;
> > -			*offs_tai = tk->offs_tai;
> > -		}
> > +		*cwsseq = tk->clock_was_set_seq;
> > +		*offs_real = tk->offs_real;
> > +		*offs_boot = tk->offs_boot;
> > +		*offs_tai = tk->offs_tai;
> 
> Adding the patch below also "fixes" this. Right now I don't see why this
> could architecture specific. Hmm.
> 
> diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
> index 3739ac6aa473..75771b15647c 100644
> --- a/kernel/time/timekeeping.c
> +++ b/kernel/time/timekeeping.c
> @@ -1835,7 +1835,7 @@ void update_wall_time(void)
>  	 * memcpy under the tk_core.seq against one before we start
>  	 * updating.
>  	 */
> -	timekeeping_update(tk, clock_set);
> +	timekeeping_update(tk, clock_set | TK_CLOCK_WAS_SET);
>  	memcpy(real_tk, tk, sizeof(*tk));
>  	/* The memcpy must come last. Do not put anything here! */
>  	write_seqcount_end(&tk_core.seq);

Well, the latter is incrementing the sequence count on every wall time
update.

The question is why the hrtimer code is not seeing that the clock was
set at some point during boot.

Lemme dig into that.

Thanks,

	tglx


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