[PATCH] fix 32bit overflow in timespec_to_sample()
From: Oleg Nesterov
Date: Thu Nov 24 2005 - 09:47:18 EST
fix 32bit overflow in timespec_to_sample()
Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
--- 2.6.14-rc/kernel/posix-cpu-timers.c~ 2005-10-26 23:33:12.000000000 +0400
+++ 2.6.14-rc/kernel/posix-cpu-timers.c 2005-10-26 23:35:53.000000000 +0400
@@ -36,7 +36,7 @@ timespec_to_sample(clockid_t which_clock
union cpu_time_count ret;
ret.sched = 0; /* high half always zero when .cpu used */
if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED) {
- ret.sched = tp->tv_sec * NSEC_PER_SEC + tp->tv_nsec;
+ ret.sched = (unsigned long long)tp->tv_sec * NSEC_PER_SEC + tp->tv_nsec;
} else {
ret.cpu = timespec_to_cputime(tp);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/