opnsense-src/lib/libthr/thread
Mark Johnston d146da5d08 libthr: Force the thr_wake() symbol to be resolved during initialization
Otherwise the lock upgrade performed by rtld's load_filtees() can result
in infinite recursion, wherein:
1. _rtld_bind() acquires the bind read lock,
2. the source DSO's filtees haven't been loaded yet, so the lock upgrade
   in load_filtees() cause rtld to jump to _rtld_bind() and release the
   bind lock,
3. _thr_rtld_lock_release() calls _thr_ast(), which calls thr_wake(),
   which hasn't been resolved yet,
4. _rtld_bind() acquires the bind read lock in order to resolve
   thr_wake(),
5. ...

See the linked pull request for an instance of this problem arising with
libsys.  That particular instance is also worked around by commit
e7951d0b04e6.

Reported by:	brooks
Reviewed by:	kib
Pull Request:	https://github.com/freebsd/freebsd-src/pull/908
MFC after:	1 week
Sponsored by:	Innovate UK

(cherry picked from commit 36f0a34ca645d49ec79d60ea7e773374ef0991ea)
2024-02-09 09:55:46 -05:00
..
Makefile.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
thr_affinity.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_attr.c pthread_attr_get_np(): Use malloc(), report ENOMEM, don't tamper on error 2024-01-26 22:01:30 +01:00
thr_autoinit.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_barrier.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_barrierattr.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_cancel.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_clean.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_concurrency.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_cond.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_condattr.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_create.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_ctrdtr.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_detach.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_equal.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_event.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_exit.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_fork.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_getcpuclockid.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_getprio.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_getschedparam.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_getthreadid_np.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_info.c libc: export pthread_getname_np stub 2023-08-21 01:44:17 +03:00
thr_init.c libc: export pthread_getname_np stub 2023-08-21 01:44:17 +03:00
thr_join.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_kern.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_kill.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_list.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_main_np.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_malloc.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_multi_np.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_mutex.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_mutexattr.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_once.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_printf.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_private.h pthread_attr_get_np(): Use malloc(), report ENOMEM, don't tamper on error 2024-01-26 22:01:30 +01:00
thr_pshared.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_pspinlock.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_resume_np.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_rtld.c libthr: Force the thr_wake() symbol to be resolved during initialization 2024-02-09 09:55:46 -05:00
thr_rwlock.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_rwlockattr.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_self.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_sem.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_setprio.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_setschedparam.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_sig.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_single_np.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_sleepq.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_spec.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_spinlock.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_stack.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_suspend_np.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_switch_np.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_symbols.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_syscalls.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_umtx.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
thr_umtx.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
thr_yield.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00