[3.13.y-ckt stable] Patch "clocksource: Fix abs() usage w/ 64bit values" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Fri Nov 13 21:48:15 UTC 2015


This is a note to let you know that I have just added a patch titled

    clocksource: Fix abs() usage w/ 64bit values

to the linux-3.13.y-queue branch of the 3.13.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.13.y-queue

This patch is scheduled to be released in version 3.13.11-ckt30.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.13.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From 3af49de0da49f54bd8efabd54c72261cc168b326 Mon Sep 17 00:00:00 2001
From: John Stultz <john.stultz at linaro.org>
Date: Mon, 14 Sep 2015 18:05:20 -0700
Subject: clocksource: Fix abs() usage w/ 64bit values

commit 67dfae0cd72fec5cd158b6e5fb1647b7dbe0834c upstream.

This patch fixes one cases where abs() was being used with 64-bit
nanosecond values, where the result may be capped at 32-bits.

This potentially could cause watchdog false negatives on 32-bit
systems, so this patch addresses the issue by using abs64().

Signed-off-by: John Stultz <john.stultz at linaro.org>
Cc: Prarit Bhargava <prarit at redhat.com>
Cc: Richard Cochran <richardcochran at gmail.com>
Cc: Ingo Molnar <mingo at kernel.org>
Link: http://lkml.kernel.org/r/1442279124-7309-2-git-send-email-john.stultz@linaro.org
Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 kernel/time/clocksource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index ba3e502..64ebaca 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -294,7 +294,7 @@ static void clocksource_watchdog(unsigned long data)
 			continue;

 		/* Check the deviation from the watchdog clocksource. */
-		if ((abs(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD)) {
+		if (abs64(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD) {
 			clocksource_unstable(cs, cs_nsec - wd_nsec);
 			continue;
 		}
--
1.9.1





More information about the kernel-team mailing list