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: <20120713060431.GF18065@gmail.com>
Date:	Fri, 13 Jul 2012 08:04:31 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	John Stultz <john.stultz@...aro.org>
Cc:	Linux Kernel <linux-kernel@...r.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Richard Cochran <richardcochran@...il.com>,
	Prarit Bhargava <prarit@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	John Stultz <johnstul@...ibm.com>
Subject: Re: [PATCH 7/8] time: Move xtime_nsec adjustment underflow handling
 timekeeping_adjust


* John Stultz <john.stultz@...aro.org> wrote:

> When we make adjustments speeding up the clock, its possible
> for xtime_nsec to underflow. We already handle this properly,
> but we do so from update_wall_time() instead of the more logical
> timekeeping_adjust(), where the possible underflow actually
> occurs.
> 
> Thus, move the correction logic to the timekeeping_adjust, which
> is the function that causes the issue. Making update_wall_time()
> more readable.
> 
> CC: Ingo Molnar <mingo@...nel.org>
> CC: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> CC: Richard Cochran <richardcochran@...il.com>
> CC: Prarit Bhargava <prarit@...hat.com>
> CC: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: John Stultz <johnstul@...ibm.com>
> ---
>  kernel/time/timekeeping.c |   42 +++++++++++++++++++++---------------------
>  1 file changed, 21 insertions(+), 21 deletions(-)
> 
> diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
> index dd119355..4b76432 100644
> --- a/kernel/time/timekeeping.c
> +++ b/kernel/time/timekeeping.c
> @@ -987,6 +987,27 @@ static void timekeeping_adjust(s64 offset)
>  	timekeeper.xtime_nsec -= offset;
>  	timekeeper.ntp_error -= (interval - offset) <<
>  				timekeeper.ntp_error_shift;
> +
> +	/*
> +	 * It may be possible that when we entered this function, xtime_nsec
> +	 * was very small.  Further, if we're slightly speeding the clocksource
> +	 * in the code above, its possible the required corrective factor to
> +	 * xtime_nsec could cause it to underflow.

s/slightly speeding/slightly speeding up ?

> +	 *
> +	 * Now, since we already accumulated the second, cannot simply roll
> +	 * the accumulated second back, since the NTP subsystem has been

s/cannot/we cannot ?

Thanks,

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