]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix lll_unlock twice in pthread_cond_broadcast
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 30 Apr 2014 10:16:18 +0000 (15:46 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Wed, 30 Apr 2014 10:16:19 +0000 (15:46 +0530)
lll_unlock() will be called again if it goes to "wake_all" in
pthread_cond_broadcast(). This may make another thread which is
waiting for lock in pthread_cond_timedwait() unlock.  So there are
more than one threads get the lock, it will break the shared data.

It's introduced by commit 8313cb997d2d("FUTEX_*_REQUEUE_PI support for
non-x86 code")

ChangeLog
nptl/pthread_cond_broadcast.c

index 2b0821fd2771057657790ab73ef9a98e8c3f0865..6bacb5c25d17b5c1b0910591d7c0832dcd56b9d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-04-30  Yang Yingliang  <yangyingliang@huawei.com>
+
+       * nptl/pthread_cond_broadcast.c (__pthread_cond_broadcast):
+       Return immediately after lll_futex_wake.
+
 2014-04-30  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
        [BZ #16791]
index ed30e7c60bc7ced3a197c6f3bc9fdb76f26e6db0..7c6c9ea9a2d56e14f1ad2633bb2ab34656e948ea 100644 (file)
@@ -81,6 +81,7 @@ __pthread_cond_broadcast (cond)
 
 wake_all:
       lll_futex_wake (&cond->__data.__futex, INT_MAX, pshared);
+      return 0;
     }
 
   /* We are done.  */