This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.23-120-g7a25d6a


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  7a25d6a84df9fea56963569ceccaaf7c2a88f161 (commit)
      from  3c9a4cd16cbc7b79094fec68add2df66061ab5d7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7a25d6a84df9fea56963569ceccaaf7c2a88f161

commit 7a25d6a84df9fea56963569ceccaaf7c2a88f161
Author: Nick Alcock <nick.alcock@oracle.com>
Date:   Wed Mar 23 13:40:14 2016 +0100

    x86, pthread_cond_*wait: Do not depend on %eax not being clobbered
    
    The x86-specific versions of both pthread_cond_wait and
    pthread_cond_timedwait have (in their fall-back-to-futex-wait slow
    paths) calls to __pthread_mutex_cond_lock_adjust followed by
    __pthread_mutex_unlock_usercnt, which load the parameters before the
    first call but then assume that the first parameter, in %eax, will
    survive unaffected.  This happens to have been true before now, but %eax
    is a call-clobbered register, and this assumption is not safe: it could
    change at any time, at GCC's whim, and indeed the stack-protector canary
    checking code clobbers %eax while checking that the canary is
    uncorrupted.
    
    So reload %eax before calling __pthread_mutex_unlock_usercnt.  (Do this
    unconditionally, even when stack-protection is not in use, because it's
    the right thing to do, it's a slow path, and anything else is dicing
    with death.)
    
    	* sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S: Reload
    	call-clobbered %eax on retry path.
    	* sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S: Likewise.

diff --git a/ChangeLog b/ChangeLog
index 54454a5..b7574b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-03-23  Nick Alcock  <nick.alcock@oracle.com>
+
+	* sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S: Reload
+        call-clobbered %eax on retry path.
+        * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S: Likewise.
+
 2016-03-22  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S (MEMCPY):
diff --git a/sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S b/sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
index 96f8a8d..6256376 100644
--- a/sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
+++ b/sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
@@ -297,6 +297,7 @@ __pthread_cond_timedwait:
 	   correctly.  */
 	movl	dep_mutex(%ebx), %eax
 	call	__pthread_mutex_cond_lock_adjust
+	movl	dep_mutex(%ebx), %eax
 	xorl	%edx, %edx
 	call	__pthread_mutex_unlock_usercnt
 	jmp	8b
diff --git a/sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S b/sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
index 94302b0..5016718 100644
--- a/sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
+++ b/sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
@@ -309,6 +309,7 @@ __pthread_cond_wait:
 	   correctly.  */
 	movl	dep_mutex(%ebx), %eax
 	call    __pthread_mutex_cond_lock_adjust
+	movl	dep_mutex(%ebx), %eax
 	xorl	%edx, %edx
 	call	__pthread_mutex_unlock_usercnt
 	jmp	8b

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |    6 ++++++
 .../unix/sysv/linux/i386/pthread_cond_timedwait.S  |    1 +
 sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S   |    1 +
 3 files changed, 8 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]