From: Atsushi Nemoto Date: Mon, 6 Mar 2006 23:42:42 +0000 (-0800) Subject: [PATCH] x86: fix potential jiffies overflow in timer_resume() X-Git-Tag: v2.6.16-rc6~102 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=f7c09bd972b7111b8c69bf57a189571edd4d4a7d;p=linux-2.6-omap-h63xx.git [PATCH] x86: fix potential jiffies overflow in timer_resume() i386 timer_resume is updating jiffies, not jiffies_64. It looks there is a potential overflow problem. And jiffies_64 and wall_jiffies should be protected by xtime_lock. Signed-off-by: Atsushi Nemoto Cc: john stultz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c index a14d594bfbe..9d307475985 100644 --- a/arch/i386/kernel/time.c +++ b/arch/i386/kernel/time.c @@ -412,9 +412,9 @@ static int timer_resume(struct sys_device *dev) write_seqlock_irqsave(&xtime_lock, flags); xtime.tv_sec = sec; xtime.tv_nsec = 0; - write_sequnlock_irqrestore(&xtime_lock, flags); - jiffies += sleep_length; + jiffies_64 += sleep_length; wall_jiffies += sleep_length; + write_sequnlock_irqrestore(&xtime_lock, flags); if (last_timer->resume) last_timer->resume(); cur_timer = last_timer;