]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
PowerPC: Fix gettimeofday ifunc selection
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Mon, 20 Jan 2014 18:29:51 +0000 (12:29 -0600)
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Fri, 16 Jan 2015 02:05:54 +0000 (21:05 -0500)
The IFUNC selector for gettimeofday runs before _libc_vdso_platform_setup where
__vdso_gettimeofday is set. The selector then sets __gettimeofday (the internal
version used within GLIBC) to use the system call version instead of the vDSO one.
This patch changes the check if vDSO is available to get its value directly
instead of rely on __vdso_gettimeofday.

This patch changes it by getting the vDSO value directly.

It fixes BZ#16431.

ChangeLog
NEWS
sysdeps/unix/sysv/linux/powerpc/gettimeofday.c

index aa456cfa38483dba900687ecb2da26d9b78f8538..499d43cdb64919ea09c392c6af566c7c5fbb208a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-01-20  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+       [BZ#16431]
+       * sysdeps/unix/sysv/linux/powerpc/gettimeofday.c (__gettimeofday):
+       Adjust the vDSO correctly for internal calls.
+       * sysdeps/unix/sysv/linux/powerpc/time.c (time): Likewise.
+
 2014-01-16  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
        [BZ#16430]
diff --git a/NEWS b/NEWS
index a2eb300968640a013b32a7cc3b400d699125caf7..aa9544fa30344e13da981cb6045199ae3a6f4f9d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,8 +10,8 @@ Version 2.16.1
 * The following bugs are resolved with this release:
 
   6530, 14195, 14547, 14459, 14476, 14562, 14621, 14648, 14699, 14756, 14831,
-  15078, 15754, 15755, 16072, 16617, 17048, 17137, 17187, 17325, 17625,
-  17630.
+  15078, 15754, 15755, 16072, 16431, 16617, 17048, 17137, 17187, 17325,
+  17625, 17630.
 
 * CVE-2104-7817 The wordexp function could ignore the WRDE_NOCMD flag
   under certain input conditions resulting in the execution of a shell for
index cc5d82e10a3d2d56a8d4016f4b752789490405eb..267fa1dbb472d2b29097ea22020281f236cc83bb 100644 (file)
@@ -34,9 +34,12 @@ __gettimeofday_syscall (struct timeval *tv, struct timezone *tz)
 void *
 gettimeofday_ifunc (void)
 {
+  PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565);
+
   /* If the vDSO is not available we fall back syscall.  */
-  return (__vdso_gettimeofday ? VDSO_IFUNC_RET (__vdso_gettimeofday)
-         : __gettimeofday_syscall);
+  void *vdso_gettimeofday = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615);
+  return (vdso_gettimeofday ? VDSO_IFUNC_RET (vdso_gettimeofday)
+         : (void*)__gettimeofday_syscall);
 }
 asm (".type __gettimeofday, %gnu_indirect_function");