diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2017-01-24 16:47:06 +0000 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2017-01-24 16:47:06 +0000 |
commit | fcfedfe2d7b7ecbac9d51a04e6397992b3753182 (patch) | |
tree | f6beb710f3eb2437abca410d936ae84488ed3fa1 | |
parent | 7d16c41cbfca369078cbaf60ac4a6b751d526c49 (diff) | |
download | FreeBSD-src-fcfedfe2d7b7ecbac9d51a04e6397992b3753182.zip FreeBSD-src-fcfedfe2d7b7ecbac9d51a04e6397992b3753182.tar.gz |
MFC r310025:
Take write lock for rtld_bind before modifying obj_list in dl_iterate_phdr().
-rw-r--r-- | libexec/rtld-elf/rtld.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 2ca08ef..1be409b 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -3470,7 +3470,7 @@ dl_iterate_phdr(__dl_iterate_hdr_callback callback, void *param) error = 0; wlock_acquire(rtld_phdr_lock, &phdr_lockstate); - rlock_acquire(rtld_bind_lock, &bind_lockstate); + wlock_acquire(rtld_bind_lock, &bind_lockstate); for (obj = globallist_curr(TAILQ_FIRST(&obj_list)); obj != NULL;) { TAILQ_INSERT_AFTER(&obj_list, obj, &marker, next); rtld_fill_dl_phdr_info(obj, &phdr_info); @@ -3478,7 +3478,7 @@ dl_iterate_phdr(__dl_iterate_hdr_callback callback, void *param) error = callback(&phdr_info, sizeof phdr_info, param); - rlock_acquire(rtld_bind_lock, &bind_lockstate); + wlock_acquire(rtld_bind_lock, &bind_lockstate); obj = globallist_next(&marker); TAILQ_REMOVE(&obj_list, &marker, next); if (error != 0) { |