Skip to content

Commit 90675a2

Browse files
Daniel WalkerLinus Torvalds
authored andcommitted
[PATCH] fix vsyscall settimeofday
I've only seen this on x86_64. The vsyscall state only gets updated when a timer interrupts comes in. So if the time is set long before the next timer, there will be a period when a gettimeofday() won't reflect the correct time. I added an explicit update_vsyscall() during the settimeofday(), that way the vsyscall state doesn't get stale. Signed-off-by: Daniel Walker <dwalker@mvista.com> Cc: Thomas Gleixner <tglx@linutronix.de> Acked-by: Ingo Molnar <mingo@elte.hu> Acked-by: John Stultz <johnstul@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 7a43481 commit 90675a2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎kernel/timer.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,8 @@ int do_settimeofday(struct timespec *tv)
862862
clock->error = 0;
863863
ntp_clear();
864864

865+
update_vsyscall(&xtime, clock);
866+
865867
write_sequnlock_irqrestore(&xtime_lock, flags);
866868

867869
/* signal hrtimers about time change */

0 commit comments

Comments
 (0)