]> git.ipfire.org Git - thirdparty/glibc.git/commit
powerpc: Fix write-after-destroy in lock elision [BZ #20822]
authorTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Mon, 23 Jan 2017 16:39:47 +0000 (14:39 -0200)
committerTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Mon, 23 Jan 2017 16:39:47 +0000 (14:39 -0200)
commit2762a7145bba9681b30ed5d4aed0c5d1df4329c8
treef2e6dd87e87c8aa9a1f33e22450fcfb28789f756
parent7e4405c50fc374d5e80141554c7887a52d1f9118
powerpc: Fix write-after-destroy in lock elision [BZ #20822]

The update of *adapt_count after the release of the lock causes a race
condition when thread A unlocks, thread B continues and destroys the
mutex, and thread A writes to *adapt_count.

(cherry picked from commit e9a96ea1aca4ebaa7c86e8b83b766f118d689d0f)
(with changes from commit eb1321f291515dae75c83a40c39e775fdd38e97a)
ChangeLog
sysdeps/unix/sysv/linux/powerpc/elision-lock.c
sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
sysdeps/unix/sysv/linux/powerpc/elision-unlock.c