mirror of https://git.musl-libc.org/git/musl
Browse Source
synccall may be called by AS-safe functions such as setuid/setgid after fork. although fork() resets libc.threads_minus_one, causing synccall to take the single-threaded path, synccall still takes the thread list lock. This lock may be held by another thread if for example fork() races with pthread_create(). After fork(), the value of the lock is meaningless, so clear it. maintainer's note: commitmaster8f11e6127fande4235d7067introduced this regression. the state protected by this lock is the linked list, which is entirely replaced in the child path of fork (next=prev=self), so resetting it is semantically sound.
committed by
Rich Felker
1 changed files with 1 additions and 0 deletions
Loading…
Reference in new issue