diff options
author | Stefan Liebler <stli@linux.ibm.com> | 2019-02-07 15:18:36 +0100 |
---|---|---|
committer | Stefan Liebler <stli@linux.ibm.com> | 2019-02-07 15:39:15 +0100 |
commit | a9f60b1571cc7821cd6bc4dbeba12194d484e7f5 (patch) | |
tree | 0812ab66742709e91d50e9b86c9c588f53bac9d3 /sysdeps/unix/sysv/linux/tcflow.c | |
parent | 85224b0290ed9302fc3289b0e388792be557f073 (diff) | |
download | glibc-a9f60b1571cc7821cd6bc4dbeba12194d484e7f5.tar glibc-a9f60b1571cc7821cd6bc4dbeba12194d484e7f5.tar.gz glibc-a9f60b1571cc7821cd6bc4dbeba12194d484e7f5.tar.bz2 glibc-a9f60b1571cc7821cd6bc4dbeba12194d484e7f5.zip |
Add compiler barriers around modifications of the robust mutex list for pthread_mutex_trylock. [BZ #24180]
While debugging a kernel warning, Thomas Gleixner, Sebastian Sewior and
Heiko Carstens found a bug in pthread_mutex_trylock due to misordered
instructions:
140: a5 1b 00 01 oill %r1,1
144: e5 48 a0 f0 00 00 mvghi 240(%r10),0 <--- THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
14a: e3 10 a0 e0 00 24 stg %r1,224(%r10) <--- last THREAD_SETMEM of ENQUEUE_MUTEX_PI
vs (with compiler barriers):
140: a5 1b 00 01 oill %r1,1
144: e3 10 a0 e0 00 24 stg %r1,224(%r10)
14a: e5 48 a0 f0 00 00 mvghi 240(%r10),0
Please have a look at the discussion:
"Re: WARN_ON_ONCE(!new_owner) within wake_futex_pi() triggerede"
(https://lore.kernel.org/lkml/20190202112006.GB3381@osiris/)
This patch is introducing the same compiler barriers and comments
for pthread_mutex_trylock as introduced for pthread_mutex_lock and
pthread_mutex_timedlock by commit 8f9450a0b7a9e78267e8ae1ab1000ebca08e473e
"Add compiler barriers around modifications of the robust mutex list."
ChangeLog:
[BZ #24180]
* nptl/pthread_mutex_trylock.c (__pthread_mutex_trylock):
Add compiler barriers and comments.
(cherry picked from commit 823624bdc47f1f80109c9c52dee7939b9386d708)
Diffstat (limited to 'sysdeps/unix/sysv/linux/tcflow.c')
0 files changed, 0 insertions, 0 deletions