rtld: unlock bind lock when calling into crt __pthread_distribute_static_tls method
The method might require resolving and binding symbols, which means recursing on the bind lock. It is safe to unlock the bind lock, since we operate on the private object list, and user attempting to unload an object from the list of not yet fully loaded objects caused self-inflicted race. It is similar to how we treat user' init/fini methods. Reported by: stevek Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
64fbda90da
commit
b1d3e2b771
@ -5897,8 +5897,10 @@ distribute_static_tls(Objlist *list, RtldLockState *lockstate)
|
||||
obj = elm->obj;
|
||||
if (obj->marker || !obj->tls_static || obj->static_tls_copied)
|
||||
continue;
|
||||
lock_release(rtld_bind_lock, lockstate);
|
||||
distrib(obj->tlsoffset, obj->tlsinit, obj->tlsinitsize,
|
||||
obj->tlssize);
|
||||
wlock_acquire(rtld_bind_lock, lockstate);
|
||||
obj->static_tls_copied = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user