diff options
author | Rich Felker <dalias@aerifal.cx> | 2015-03-04 09:29:39 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2015-03-04 09:29:39 -0500 |
commit | 7a81fe3710be0128d29071e76c5acbea3d84277b (patch) | |
tree | 1ba3a7b2433dc4671a5b516996ee9051044cc622 /src/unistd/chown.c | |
parent | 56fbaa3bbe73f12af2bfbbcf2adb196e6f9fe264 (diff) | |
download | musl-7a81fe3710be0128d29071e76c5acbea3d84277b.tar.gz musl-7a81fe3710be0128d29071e76c5acbea3d84277b.tar.xz musl-7a81fe3710be0128d29071e76c5acbea3d84277b.zip |
fix init race that could lead to deadlock in malloc init code
the malloc init code provided its own version of pthread_once type logic, including the exact same bug that was fixed in pthread_once in commit 0d0c2f40344640a2a6942dda156509593f51db5d. since this code is called adjacent to expand_heap, which takes a lock, there is no reason to have pthread_once-type initialization. simply moving the init code into the interval where expand_heap already holds its lock on the brk achieves the same result with much less synchronization logic, and allows the buggy code to be eliminated rather than just fixed.
Diffstat (limited to 'src/unistd/chown.c')
0 files changed, 0 insertions, 0 deletions