Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7c09bd9 authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Linus Torvalds
Browse files

[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: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: john stultz <johnstul@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b05121b2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;