From 2c6221483169ddd4c04797cd7296ed4fe52fcdd7 Mon Sep 17 00:00:00 2001 From: Tony Breeds Date: Thu, 18 Oct 2007 03:04:57 -0700 Subject: Fix discrepancy between VDSO based gettimeofday() and sys_gettimeofday(). On platforms that copy sys_tz into the vdso (currently only x86_64, soon to include powerpc), it is possible for the vdso to get out of sync if a user calls (admittedly unusual) settimeofday(NULL, ptr). This patch adds a hook for architectures that set CONFIG_GENERIC_TIME_VSYSCALL to ensure when sys_tz is updated they can also updatee their copy in the vdso. Signed-off-by: Tony Breeds Cc: Andi Kleen Cc: Tony Luck Acked-by: John Stultz Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/time.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'kernel/time.c') diff --git a/kernel/time.c b/kernel/time.c index 2d5b6a6..d9725bd 100644 --- a/kernel/time.c +++ b/kernel/time.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -158,6 +159,7 @@ int do_sys_settimeofday(struct timespec *tv, struct timezone *tz) if (tz) { /* SMP safe, global irq locking makes it work. */ sys_tz = *tz; + update_vsyscall_tz(); if (firsttime) { firsttime = 0; if (!tv) -- cgit v1.1