Commit f871dbd2 authored by Vladimir Grouzdev's avatar Vladimir Grouzdev Committed by Linus Torvalds

[PATCH] xtime value may become incorrect

The xtime value may become incorrect when the update_wall_time(ticks)
function is called with "ticks" > 1.  In such a case, the xtime variable is
updated multiple times inside the loop but it is normalized only once
outside of the loop.

This bug was reported at:

http://bugme.osdl.org/show_bug.cgi?id=3403Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 74477c85
...@@ -790,13 +790,12 @@ static void update_wall_time(unsigned long ticks) ...@@ -790,13 +790,12 @@ static void update_wall_time(unsigned long ticks)
do { do {
ticks--; ticks--;
update_wall_time_one_tick(); update_wall_time_one_tick();
if (xtime.tv_nsec >= 1000000000) {
xtime.tv_nsec -= 1000000000;
xtime.tv_sec++;
second_overflow();
}
} while (ticks); } while (ticks);
if (xtime.tv_nsec >= 1000000000) {
xtime.tv_nsec -= 1000000000;
xtime.tv_sec++;
second_overflow();
}
} }
static inline void do_process_times(struct task_struct *p, static inline void do_process_times(struct task_struct *p,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment