linux/arch/x86
John Wright 2f65dd475c x86: gettimeofday() vDSO: fix segfault when tv == NULL
According to the gettimeofday(2) manual:

       If either tv or tz is NULL, the corresponding structure is not
       set or returned.

Since it is legal to give NULL as the tv argument, the code should make
sure tv is not NULL before trying to dereference it.

This issue manifests itself on x86_64 when vdso=0 is not on the kernel
command-line and libc uses the vDSO for gettimeofday() (e.g. glibc >=
2.7).  A simple reproducer:

  #include <stdio.h>
  #include <sys/time.h>

  int main(void)
  {
      struct timezone tz;

      gettimeofday(NULL, &tz);

      return 0;
  }

See http://bugs.debian.org/466491 for more details.

[ Impact: fix gettimeofday(NULL, &tz) segfault ]

Signed-off-by: John Wright <john.wright@hp.com>
Cc: Andi Kleen <ak@suse.de>
Cc: John Wright <john.wright@hp.com>
LKML-Reference: <1241037121-14805-1-git-send-email-john.wright@hp.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-30 12:31:45 +02:00
..
boot x86, setup: un-resequence mode setting for VGA 80x34 and 80x60 modes 2009-04-07 10:59:25 -07:00
configs Merge branches 'x86/apic', 'x86/defconfig', 'x86/memtest', 'x86/mm' and 'linus' into x86/core 2009-02-26 06:31:32 +01:00
crypto crypto: aes-ni - Add support to Intel AES-NI instructions for x86_64 platform 2009-02-18 16:48:06 +08:00
ia32 Separate out common fstatat code into vfs_fstatat 2009-04-20 23:02:51 -04:00
include/asm x86/PCI: set_pci_bus_resources_arch_default cleanups 2009-04-22 14:47:46 -07:00
kernel Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-04-26 10:29:38 -07:00
kvm KVM: Unregister cpufreq notifier on unload 2009-04-22 13:54:33 +03:00
lguest clocksource: pass clocksource to read() callback 2009-04-21 13:41:47 -07:00
lib x86: memcpy, clean up 2009-03-12 12:21:17 +01:00
math-emu Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2 2009-03-27 17:28:43 +01:00
mm x86: check boundary in setup_node_bootmem() 2009-04-23 09:58:56 +02:00
oprofile cpumask: x86: convert cpu_sibling_map/cpu_core_map to cpumask_var_t 2009-03-13 14:49:50 +10:30
pci x86/PCI: don't bother with root quirks if _CRS is used 2009-04-22 15:06:29 -07:00
power x86: disable stack-protector for __restore_processor_state() 2009-04-03 19:48:41 +02:00
vdso x86: gettimeofday() vDSO: fix segfault when tv == NULL 2009-04-30 12:31:45 +02:00
video
xen clocksource: pass clocksource to read() callback 2009-04-21 13:41:47 -07:00
Kconfig Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-04-26 10:29:38 -07:00
Kconfig.cpu x86: disable X86_PTRACE_BTS for now 2009-04-15 23:15:14 +02:00
Kconfig.debug generic debug pagealloc: build fix 2009-04-02 19:04:48 -07:00
Makefile x86, kbuild: make "make install" not depend on vmlinux 2009-04-17 22:43:12 +02:00
Makefile_32.cpu x86: merge winchip-2 and winchip-2a cpu choices 2008-10-13 10:22:48 +02:00