forked from pool/glibc
Andreas Schwab
afe7a231ef
- pthread-rwlock-trylock-stalls.patch: nptl: Fix pthread_rwlock_try*lock stalls (BZ #23844) - arm-systemtap-probe-constraint.patch: arm: Use "nr" constraint for Systemtap probes (BZ #24164) - pthread-mutex-barrier.patch: Add compiler barriers around modifications of the robust mutex list for pthread_mutex_trylock (BZ #24180) - fork-handler-lock.patch: nptl: Avoid fork handler lock for async-signal-safe fork (BZ #24161) - pthread-join-probe.patch: nptl: Fix invalid Systemtap probe in pthread_join (BZ #24211) - riscv-clone-unwind.patch: RISC-V: Fix elfutils testsuite unwind failures (BZ #24040) OBS-URL: https://build.opensuse.org/request/show/677136 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=518
37 lines
1.1 KiB
Diff
37 lines
1.1 KiB
Diff
2019-02-15 Florian Weimer <fweimer@redhat.com>
|
|
|
|
[BZ #24211]
|
|
* nptl/pthread_join_common.c (__pthread_timedjoin_ex): Do not read
|
|
pd->result after the thread descriptor has been freed.
|
|
|
|
Index: glibc-2.29/nptl/pthread_join_common.c
|
|
===================================================================
|
|
--- glibc-2.29.orig/nptl/pthread_join_common.c
|
|
+++ glibc-2.29/nptl/pthread_join_common.c
|
|
@@ -86,6 +86,7 @@ __pthread_timedjoin_ex (pthread_t thread
|
|
pthread_cleanup_pop (0);
|
|
}
|
|
|
|
+ void *pd_result = pd->result;
|
|
if (__glibc_likely (result == 0))
|
|
{
|
|
/* We mark the thread as terminated and as joined. */
|
|
@@ -93,7 +94,7 @@ __pthread_timedjoin_ex (pthread_t thread
|
|
|
|
/* Store the return value if the caller is interested. */
|
|
if (thread_return != NULL)
|
|
- *thread_return = pd->result;
|
|
+ *thread_return = pd_result;
|
|
|
|
/* Free the TCB. */
|
|
__free_tcb (pd);
|
|
@@ -101,7 +102,7 @@ __pthread_timedjoin_ex (pthread_t thread
|
|
else
|
|
pd->joinid = NULL;
|
|
|
|
- LIBC_PROBE (pthread_join_ret, 3, threadid, result, pd->result);
|
|
+ LIBC_PROBE (pthread_join_ret, 3, threadid, result, pd_result);
|
|
|
|
return result;
|
|
}
|