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] [day] [month] [year] [list]
Date:	Fri, 06 Aug 2010 10:09:43 -0500
From:	Jason Wessel <jason.wessel@...driver.com>
To:	john stultz <johnstul@...ibm.com>
CC:	Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org,
	"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH] timekeeping: Fix overflow in rawtime tv_nsec on 32 bit
 archs

On 08/05/2010 05:17 PM, john stultz wrote:
> On Thu, 2010-08-05 at 07:28 -0500, Jason Wessel wrote:
>> The tv_nsec is a long and when added to the shift value it can wrap
>> and become negative which later causes looping problems in the
>> getrawmonotonic().  The edge case occurs when the system has slept for
>> a short period of time of ~2 seconds.
> 
> Ah, good catch!
> 
> I reworked some of the variable names to make a little more sense and
> simplified the accumulation. Do you mind giving this a test in your
> environment that triggered the issue to make sure nothing else slipped
> in?
> 


No problem.


This looks good to me.  I even increased the delay and I can see it recovers properly.

The instrumentation shows raw_nsecs would have otherwise been negative going from 90.* to 97.* in the log.

           <...>-4801  [000]    90.105084: update_wall_time: raw_nsecs: 37283ea1
           <...>-4801  [000]    90.109078: update_wall_time: raw_nsecs: 376547b4
           <...>-4801  [000]    97.694264: update_wall_time: raw_nsecs: b1776db4
           <...>-4801  [000]    97.694270: update_wall_time: raw_nsecs: b453ffb4
           <...>-4801  [000]    97.694272: update_wall_time: raw_nsecs: 7b95c7b4

Note that I had instrumented it just after:

raw_nsecs += raw_time.tv_nsec;

We should send this over to -stable when it is considered baked because this was found in the 2.6.35 and may be a problem elsewhere as well.

Thanks,
Jason.


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