aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time.c
diff options
context:
space:
mode:
authorTony Breeds <tony@bakeyournoodle.com>2007-10-18 06:04:57 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:37:20 -0400
commit2c6221483169ddd4c04797cd7296ed4fe52fcdd7 (patch)
tree1db73f0bf60b036abe995350637a9a3e916c0ec2 /kernel/time.c
parent6212e3a388fdda3f19fa660ef5a30edf54d1dcfd (diff)
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 <tony@bakeyournoodle.com> Cc: Andi Kleen <ak@suse.de> Cc: Tony Luck <tony.luck@intel.com> Acked-by: John Stultz <johnstul@us.ibm.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/time.c')
-rw-r--r--kernel/time.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/time.c b/kernel/time.c
index 2d5b6a682138..d9725bdcd045 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -30,6 +30,7 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/timex.h> 31#include <linux/timex.h>
32#include <linux/capability.h> 32#include <linux/capability.h>
33#include <linux/clocksource.h>
33#include <linux/errno.h> 34#include <linux/errno.h>
34#include <linux/syscalls.h> 35#include <linux/syscalls.h>
35#include <linux/security.h> 36#include <linux/security.h>
@@ -158,6 +159,7 @@ int do_sys_settimeofday(struct timespec *tv, struct timezone *tz)
158 if (tz) { 159 if (tz) {
159 /* SMP safe, global irq locking makes it work. */ 160 /* SMP safe, global irq locking makes it work. */
160 sys_tz = *tz; 161 sys_tz = *tz;
162 update_vsyscall_tz();
161 if (firsttime) { 163 if (firsttime) {
162 firsttime = 0; 164 firsttime = 0;
163 if (!tv) 165 if (!tv)