]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2014 18:12:02 +0000 (10:12 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2014 18:12:02 +0000 (10:12 -0800)
added patches:
3.4.y-timekeeping-fix-32-bit-overflow-in-get_monotonic_boottime.patch

queue-3.4/3.4.y-timekeeping-fix-32-bit-overflow-in-get_monotonic_boottime.patch [new file with mode: 0644]
queue-3.4/series

diff --git a/queue-3.4/3.4.y-timekeeping-fix-32-bit-overflow-in-get_monotonic_boottime.patch b/queue-3.4/3.4.y-timekeeping-fix-32-bit-overflow-in-get_monotonic_boottime.patch
new file mode 100644 (file)
index 0000000..f1bef36
--- /dev/null
@@ -0,0 +1,38 @@
+From john.stultz@linaro.org  Tue Feb 11 10:07:48 2014
+From: John Stultz <john.stultz@linaro.org>
+Date: Mon, 10 Feb 2014 13:16:29 -0800
+Subject: 3.4.y: timekeeping: fix 32-bit overflow in get_monotonic_boottime
+To: stable <stable@vger.kernel.org>
+Cc: Colin Cross <ccross@android.com>, John Stultz <john.stultz@linaro.org>
+Message-ID: <1392066989-5113-4-git-send-email-john.stultz@linaro.org>
+
+From: Colin Cross <ccross@android.com>
+
+fixed upstream in v3.6 by ec145babe754f9ea1079034a108104b6001e001c
+
+get_monotonic_boottime adds three nanonsecond values stored
+in longs, followed by an s64.  If the long values are all
+close to 1e9 the first three additions can overflow and
+become negative when added to the s64.  Cast the first
+value to s64 so that all additions are 64 bit.
+
+Signed-off-by: Colin Cross <ccross@android.com>
+[jstultz: Fished this out of the AOSP commong.git tree. This was
+fixed upstream in v3.6 by ec145babe754f9ea1079034a108104b6001e001c]
+Signed-off-by: John Stultz <john.stultz@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/time/timekeeping.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/kernel/time/timekeeping.c
++++ b/kernel/time/timekeeping.c
+@@ -1197,7 +1197,7 @@ void get_monotonic_boottime(struct times
+       } while (read_seqretry(&timekeeper.lock, seq));
+       set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec + sleep.tv_sec,
+-                      ts->tv_nsec + tomono.tv_nsec + sleep.tv_nsec + nsecs);
++              (s64)ts->tv_nsec + tomono.tv_nsec + sleep.tv_nsec + nsecs);
+ }
+ EXPORT_SYMBOL_GPL(get_monotonic_boottime);
index 420754671b530baddacc9cae9e5e3e67a6c139f4..0ba60b1c5d6431c44d3510a893c6760587ff6334 100644 (file)
@@ -27,3 +27,4 @@ sched-unthrottle-rt-runqueues-in-__disable_runtime.patch
 sched-rt-avoid-updating-rt-entry-timeout-twice-within-one.patch
 rtc-cmos-add-an-alarm-disable-quirk.patch
 timekeeping-avoid-possible-deadlock-from-clock_was_set_delayed.patch
+3.4.y-timekeeping-fix-32-bit-overflow-in-get_monotonic_boottime.patch