diff options
author | Rich Felker <dalias@aerifal.cx> | 2020-11-19 16:09:16 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2020-11-19 16:09:16 -0500 |
commit | d26e0774a59bb7245b205bc8e7d8b35cc2037095 (patch) | |
tree | 1f9921e83c473b5b1c595c99c20801d7df4d4564 /src/thread/__tls_get_addr.c | |
parent | 167390f05564e0a4d3fcb4329377fd7743267560 (diff) | |
download | musl-d26e0774a59bb7245b205bc8e7d8b35cc2037095.tar.gz musl-d26e0774a59bb7245b205bc8e7d8b35cc2037095.tar.xz musl-d26e0774a59bb7245b205bc8e7d8b35cc2037095.zip |
pthread_exit: don't __vm_wait under thread list lock
the __vm_wait operation can delay forward progress arbitrarily long if a thread holding the lock is interrupted by a signal. in a worst case this can deadlock. any critical section holding the thread list lock must respect lock ordering contracts and must not take any lock which is not AS-safe. to fix, move the determination of thread joinable/detached state to take place before the killlock and thread list lock are taken. this requires reverting the atomic state transition if we determine that the exiting thread is the last thread and must call exit, but that's easy to do since it's a single-threaded context with application signals blocked.
Diffstat (limited to 'src/thread/__tls_get_addr.c')
0 files changed, 0 insertions, 0 deletions