[glibc/f20] Fix lll_unlock twice in pthread_cond_broadcast (#1104400)
Siddhesh Poyarekar
siddhesh at fedoraproject.org
Wed Oct 1 09:35:25 UTC 2014
commit 48e40fc12cbeada142a1b99a071920222a5b0573
Author: Siddhesh Poyarekar <siddhesh at redhat.com>
Date: Wed Oct 1 15:03:44 2014 +0530
Fix lll_unlock twice in pthread_cond_broadcast (#1104400)
glibc-rh1104400.patch | 26 ++++++++++++++++++++++++++
glibc.spec | 5 +++++
2 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/glibc-rh1104400.patch b/glibc-rh1104400.patch
new file mode 100644
index 0000000..486532e
--- /dev/null
+++ b/glibc-rh1104400.patch
@@ -0,0 +1,26 @@
+commit 8f630cca5c36941db1cb48726016bbed80ec1041
+Author: Yang Yingliang <yangyingliang at huawei.com>
+Date: Wed Apr 30 15:46:18 2014 +0530
+
+ Fix lll_unlock twice in pthread_cond_broadcast
+
+ 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")
+
+diff --git a/nptl/pthread_cond_broadcast.c b/nptl/pthread_cond_broadcast.c
+index ed30e7c..7c6c9ea 100644
+--- a/nptl/pthread_cond_broadcast.c
++++ b/nptl/pthread_cond_broadcast.c
+@@ -81,6 +81,7 @@ __pthread_cond_broadcast (cond)
+
+ wake_all:
+ lll_futex_wake (&cond->__data.__futex, INT_MAX, pshared);
++ return 0;
+ }
+
+ /* We are done. */
diff --git a/glibc.spec b/glibc.spec
index d0421ac..32f99af 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -197,6 +197,7 @@ Patch1005: %{name}-rh1019452.patch
Patch1006: %{name}-rh1118581.patch
Patch1007: %{name}-rh1118581-2.patch
+Patch1008: %{name}-rh1104400.patch
#
# Patches submitted, but not yet approved upstream.
@@ -578,6 +579,7 @@ package or when debugging this package.
%patch0044 -p1
%patch1006 -p1
%patch1007 -p1
+%patch1008 -p1
##############################################################################
# %%prep - Additional prep required...
@@ -1667,6 +1669,9 @@ rm -f *.filelist*
%endif
%changelog
+* Wed Oct 1 2014 Siddhesh Poyarekar <siddhesh at redhat.com> - 2.18-17
+- Fix lll_unlock twice in pthread_cond_broadcast (#1104400).
+
* Fri Sep 26 2014 Carlos O'Donell <carlos at redhat.com> - 2.18-16
- Disable lock elision support for Intel hardware until microcode
updates can be done in early bootup (#1146967).
More information about the scm-commits
mailing list