Andreas Schwab noted that the 1 << tk->shift could overflow if the shift value was greater then 30, since 1 would be a 32bit long on 32bit architectures.
This patch uses 1ULL instead to ensure we don't overflow on the shift. This issue was introduced by 1e75fa8be9fb61e1af46b5b3b176347a4c958ca1 Cc: Ingo Molnar <mi...@kernel.org> Cc: Prarit Bhargava <pra...@redhat.com> Cc: Thomas Gleixner <t...@linutronix.de> Cc: Andreas Schwab <sch...@linux-m68k.org> Reported-by: Andreas Schwab <sch...@linux-m68k.org> Signed-off-by: John Stultz <john.stu...@linaro.org> --- kernel/time/timekeeping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 1dbf80e..a5a9389 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1184,9 +1184,9 @@ static void update_wall_time(void) * the vsyscall implementations are converted to use xtime_nsec * (shifted nanoseconds), this can be killed. */ - remainder = tk->xtime_nsec & ((1 << tk->shift) - 1); + remainder = tk->xtime_nsec & ((1ULL << tk->shift) - 1); tk->xtime_nsec -= remainder; - tk->xtime_nsec += 1 << tk->shift; + tk->xtime_nsec += 1ULL << tk->shift; tk->ntp_error += remainder << tk->ntp_error_shift; /* -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/