[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-85dc8f05c93c8105987de9d7e7cebf15a72ff4ec@git.kernel.org>
Date: Wed, 22 Aug 2012 01:51:09 -0700
From: tip-bot for Andreas Schwab <schwab@...ux-m68k.org>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, john.stultz@...aro.org,
hpa@...or.com, mingo@...nel.org, schwab@...ux-m68k.org,
tglx@...utronix.de, prarit@...hat.com
Subject: [tip:timers/urgent] time:
Fix casting issue in timekeeping_forward_now
Commit-ID: 85dc8f05c93c8105987de9d7e7cebf15a72ff4ec
Gitweb: http://git.kernel.org/tip/85dc8f05c93c8105987de9d7e7cebf15a72ff4ec
Author: Andreas Schwab <schwab@...ux-m68k.org>
AuthorDate: Tue, 21 Aug 2012 20:30:47 -0400
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Wed, 22 Aug 2012 10:42:13 +0200
time: Fix casting issue in timekeeping_forward_now
arch_gettimeoffset returns a u32 value which when shifted by tk->shift
can overflow. This issue was introduced with 1e75fa8be (time: Condense
timekeeper.xtime into xtime_sec)
Cast it to u64 first.
Signed-off-by: Andreas Schwab <schwab@...ux-m68k.org>
Signed-off-by: John Stultz <john.stultz@...aro.org>
Cc: Prarit Bhargava <prarit@...hat.com>
Cc: Ingo Molnar <mingo@...nel.org>
Link: http://lkml.kernel.org/r/1345595449-34965-3-git-send-email-john.stultz@linaro.org
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
kernel/time/timekeeping.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 258164a..1dbf80e 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -277,7 +277,7 @@ static void timekeeping_forward_now(struct timekeeper *tk)
tk->xtime_nsec += cycle_delta * tk->mult;
/* If arch requires, add in gettimeoffset() */
- tk->xtime_nsec += arch_gettimeoffset() << tk->shift;
+ tk->xtime_nsec += (u64)arch_gettimeoffset() << tk->shift;
tk_normalize_xtime(tk);
--
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