aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-01-20 12:29:51 -0600
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2015-01-15 21:05:54 -0500
commit1442655ba419867ce1a045a97cdd7904ac1ad516 (patch)
treec543a99f2be58b1e1811da1388b6101c5f5629a3
parent1bdb6daceb10307543599df3b118afd2109d2ec8 (diff)
downloadglibc-1442655ba419867ce1a045a97cdd7904ac1ad516.zip
glibc-1442655ba419867ce1a045a97cdd7904ac1ad516.tar.gz
glibc-1442655ba419867ce1a045a97cdd7904ac1ad516.tar.bz2
PowerPC: Fix gettimeofday ifunc selection
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.
-rw-r--r--ChangeLog7
-rw-r--r--NEWS4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/gettimeofday.c7
3 files changed, 14 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index aa456cf..499d43c 100644
--- 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 a2eb300..aa9544f 100644
--- 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
diff --git a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
index cc5d82e..267fa1d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
@@ -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");