Date: Wed, 27 Jan 2016 20:20:37 +0000 (UTC) From: Alexander Kabaev <kan@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294936 - head/libexec/rtld-elf Message-ID: <201601272020.u0RKKbwr080622@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kan Date: Wed Jan 27 20:20:37 2016 New Revision: 294936 URL: https://svnweb.freebsd.org/changeset/base/294936 Log: Do not unlock rtld_phdr_lock over callback invocations. The dl_iterate_phdr consumer code in libgcc does not expect multiple callbacks running concurrently. This was fixed once already in r178807, but accidentally got reverted in r294373. Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Jan 27 20:20:35 2016 (r294935) +++ head/libexec/rtld-elf/rtld.c Wed Jan 27 20:20:37 2016 (r294936) @@ -3533,11 +3533,9 @@ dl_iterate_phdr(__dl_iterate_hdr_callbac TAILQ_INSERT_AFTER(&obj_list, obj, &marker, next); rtld_fill_dl_phdr_info(obj, &phdr_info); lock_release(rtld_bind_lock, &bind_lockstate); - lock_release(rtld_phdr_lock, &phdr_lockstate); error = callback(&phdr_info, sizeof phdr_info, param); - wlock_acquire(rtld_phdr_lock, &phdr_lockstate); rlock_acquire(rtld_bind_lock, &bind_lockstate); obj = globallist_next(&marker); TAILQ_REMOVE(&obj_list, &marker, next); @@ -3551,9 +3549,9 @@ dl_iterate_phdr(__dl_iterate_hdr_callbac if (error == 0) { rtld_fill_dl_phdr_info(&obj_rtld, &phdr_info); lock_release(rtld_bind_lock, &bind_lockstate); - lock_release(rtld_phdr_lock, &phdr_lockstate); error = callback(&phdr_info, sizeof(phdr_info), param); } + lock_release(rtld_phdr_lock, &phdr_lockstate); return (error); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601272020.u0RKKbwr080622>