Date: Tue, 3 Jan 2017 23:28:07 +0000 (UTC) From: Bryan Drewery <bdrewery@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311202 - stable/11/libexec/rtld-elf Message-ID: <201701032328.v03NS7La056001@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdrewery Date: Tue Jan 3 23:28:07 2017 New Revision: 311202 URL: https://svnweb.freebsd.org/changeset/base/311202 Log: MFC r310025: Take write lock for rtld_bind before modifying obj_list in dl_iterate_phdr(). Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Tue Jan 3 23:25:55 2017 (r311201) +++ stable/11/libexec/rtld-elf/rtld.c Tue Jan 3 23:28:07 2017 (r311202) @@ -3545,7 +3545,7 @@ dl_iterate_phdr(__dl_iterate_hdr_callbac 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); @@ -3553,7 +3553,7 @@ dl_iterate_phdr(__dl_iterate_hdr_callbac 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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701032328.v03NS7La056001>