Patch "3.4.y: timekeeping: fix 32-bit overflow in get_monotonic_boottime" has been added to the 3.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    3.4.y: timekeeping: fix 32-bit overflow in get_monotonic_boottime

to the 3.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     3.4.y-timekeeping-fix-32-bit-overflow-in-get_monotonic_boottime.patch
and it can be found in the queue-3.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From john.stultz@xxxxxxxxxx  Tue Feb 11 10:07:48 2014
From: John Stultz <john.stultz@xxxxxxxxxx>
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@xxxxxxxxxxxxxxx>
Cc: Colin Cross <ccross@xxxxxxxxxxx>, John Stultz <john.stultz@xxxxxxxxxx>
Message-ID: <1392066989-5113-4-git-send-email-john.stultz@xxxxxxxxxx>

From: Colin Cross <ccross@xxxxxxxxxxx>

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@xxxxxxxxxxx>
[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@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 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);
 


Patches currently in stable-queue which might be from john.stultz@xxxxxxxxxx are

queue-3.4/3.4.y-timekeeping-fix-32-bit-overflow-in-get_monotonic_boottime.patch
queue-3.4/rtc-cmos-add-an-alarm-disable-quirk.patch
queue-3.4/timekeeping-avoid-possible-deadlock-from-clock_was_set_delayed.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]