Messages in this thread Patch in this message | | | Date | Thu, 24 Nov 2005 19:02:00 +0300 | From | Oleg Nesterov <> | Subject | [PATCH] fix 32bit overflow in timespec_to_sample() |
| |
fix 32bit overflow in timespec_to_sample()
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |