]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rtld-elf: Avoid unnecessary lock_restart_for_upgrade() calls
authorMark Johnston <markj@FreeBSD.org>
Thu, 1 Feb 2024 22:43:05 +0000 (17:43 -0500)
committerMark Johnston <markj@FreeBSD.org>
Fri, 2 Feb 2024 14:39:54 +0000 (09:39 -0500)
commite7951d0b04e6464b37264b8166b1e9ce368a9f1d
treee921b6b7d7c756ac5f7c2596d04262c86c3953ee
parent9bbe06b004e2cadb55a3792c77991ee640bf0f52
rtld-elf: Avoid unnecessary lock_restart_for_upgrade() calls

In order to atomically upgrade the rtld bind lock, load_filtees() may
trigger a longjmp back to _rtld_bind() so that the binding can be done
with the write lock held.  However, the write lock is only needed when
filtee objects haven't already been loaded, so move the
lock_restart_for_upgrade() call to avoid unnecessary lock upgrades when
a filtee is defined.

Reviewed by: kib
Tested by: brooks
MFC after: 1 week
Sponsored by: Innovate UK
libexec/rtld-elf/rtld.c