mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-30 23:48:09 +01:00
8495e8b1e9
(or loading a dso linked to libthr.so into process which was not linked against threading library). - Remove libthr interposers of the libc functions, including __error(). Instead, functions calls are indirected through the interposing table, similar to how pthread stubs in libc are already done. Libc by default points either to syscall trampolines or to existing libc implementations. On libthr load, libthr rewrites the pointers to the cancellable implementations already in libthr. The interposition table is separate from pthreads stubs indirection table to not pull pthreads stubs into static binaries. - Postpone the malloc(3) internal mutexes initialization until libthr is loaded. This avoids recursion between calloc(3) and static pthread_mutex_t initialization. - Reinstall signal handlers with wrapper on libthr load. The _rtld_is_dlopened(3) is used to avoid useless calls to sigaction(2) when libthr is statically referenced from the main binary. In the process, fix openat(2), swapcontext(2) and setcontext(2) interposing. The libc symbols were exported at different versions than libthr interposers. Export both libc and libthr versions from libc now, with default set to the higher version from libthr. Remove unused and disconnected swapcontext(3) userspace implementation from libc/gen. No objections from: deischen Tested by: pho, antoine (exp-run) (previous versions) Sponsored by: The FreeBSD Foundation MFC after: 1 week
320 lines
7.5 KiB
Plaintext
320 lines
7.5 KiB
Plaintext
/*
|
|
* $FreeBSD$
|
|
*/
|
|
|
|
/*
|
|
* Use the same naming scheme as libc.
|
|
*/
|
|
FBSD_1.0 {
|
|
pthread_atfork;
|
|
pthread_barrier_destroy;
|
|
pthread_barrier_init;
|
|
pthread_barrier_wait;
|
|
pthread_barrierattr_destroy;
|
|
pthread_barrierattr_getpshared;
|
|
pthread_barrierattr_init;
|
|
pthread_barrierattr_setpshared;
|
|
pthread_attr_destroy;
|
|
pthread_attr_get_np;
|
|
pthread_attr_getdetachstate;
|
|
pthread_attr_getguardsize;
|
|
pthread_attr_getinheritsched;
|
|
pthread_attr_getschedparam;
|
|
pthread_attr_getschedpolicy;
|
|
pthread_attr_getscope;
|
|
pthread_attr_getstack;
|
|
pthread_attr_getstackaddr;
|
|
pthread_attr_getstacksize;
|
|
pthread_attr_init;
|
|
pthread_attr_setcreatesuspend_np;
|
|
pthread_attr_setdetachstate;
|
|
pthread_attr_setguardsize;
|
|
pthread_attr_setinheritsched;
|
|
pthread_attr_setschedparam;
|
|
pthread_attr_setschedpolicy;
|
|
pthread_attr_setscope;
|
|
pthread_attr_setstack;
|
|
pthread_attr_setstackaddr;
|
|
pthread_attr_setstacksize;
|
|
pthread_cancel;
|
|
pthread_cleanup_pop;
|
|
pthread_cleanup_push;
|
|
pthread_cond_broadcast;
|
|
pthread_cond_destroy;
|
|
pthread_cond_init;
|
|
pthread_cond_signal;
|
|
pthread_cond_timedwait;
|
|
pthread_cond_wait;
|
|
pthread_condattr_destroy;
|
|
pthread_condattr_getclock;
|
|
pthread_condattr_getpshared;
|
|
pthread_condattr_init;
|
|
pthread_condattr_setclock;
|
|
pthread_condattr_setpshared;
|
|
pthread_create;
|
|
pthread_detach;
|
|
pthread_equal;
|
|
pthread_exit;
|
|
pthread_getconcurrency;
|
|
pthread_getprio;
|
|
pthread_getschedparam;
|
|
pthread_getspecific;
|
|
pthread_join;
|
|
pthread_key_create;
|
|
pthread_key_delete;
|
|
pthread_kill;
|
|
pthread_main_np;
|
|
pthread_multi_np;
|
|
pthread_mutex_destroy;
|
|
pthread_mutex_getprioceiling;
|
|
pthread_mutex_init;
|
|
pthread_mutex_lock;
|
|
pthread_mutex_setprioceiling;
|
|
pthread_mutex_timedlock;
|
|
pthread_mutex_trylock;
|
|
pthread_mutex_unlock;
|
|
pthread_mutexattr_destroy;
|
|
pthread_mutexattr_getkind_np;
|
|
pthread_mutexattr_getprioceiling;
|
|
pthread_mutexattr_getpshared;
|
|
pthread_mutexattr_getprotocol;
|
|
pthread_mutexattr_gettype;
|
|
pthread_mutexattr_init;
|
|
pthread_mutexattr_setkind_np;
|
|
pthread_mutexattr_setprioceiling;
|
|
pthread_mutexattr_setprotocol;
|
|
pthread_mutexattr_setpshared;
|
|
pthread_mutexattr_settype;
|
|
pthread_once;
|
|
pthread_resume_all_np;
|
|
pthread_resume_np;
|
|
pthread_rwlock_destroy;
|
|
pthread_rwlock_init;
|
|
pthread_rwlock_rdlock;
|
|
pthread_rwlock_timedrdlock;
|
|
pthread_rwlock_timedwrlock;
|
|
pthread_rwlock_tryrdlock;
|
|
pthread_rwlock_trywrlock;
|
|
pthread_rwlock_unlock;
|
|
pthread_rwlock_wrlock;
|
|
pthread_rwlockattr_destroy;
|
|
pthread_rwlockattr_getpshared;
|
|
pthread_rwlockattr_init;
|
|
pthread_rwlockattr_setpshared;
|
|
pthread_set_name_np;
|
|
pthread_self;
|
|
pthread_setcancelstate;
|
|
pthread_setcanceltype;
|
|
pthread_setconcurrency;
|
|
pthread_setprio;
|
|
pthread_setschedparam;
|
|
pthread_setspecific;
|
|
pthread_sigmask;
|
|
pthread_single_np;
|
|
pthread_spin_destroy;
|
|
pthread_spin_init;
|
|
pthread_spin_lock;
|
|
pthread_spin_trylock;
|
|
pthread_spin_unlock;
|
|
pthread_suspend_all_np;
|
|
pthread_suspend_np;
|
|
pthread_switch_add_np;
|
|
pthread_switch_delete_np;
|
|
pthread_testcancel;
|
|
pthread_timedjoin_np;
|
|
pthread_yield;
|
|
};
|
|
|
|
/*
|
|
* List the private interfaces reserved for use in FreeBSD libraries.
|
|
* These are not part of our application ABI.
|
|
*/
|
|
FBSDprivate_1.0 {
|
|
__pthread_cond_timedwait;
|
|
__pthread_cond_wait;
|
|
__pthread_cxa_finalize;
|
|
__pthread_mutex_init;
|
|
__pthread_mutex_lock;
|
|
__pthread_mutex_timedlock;
|
|
__pthread_mutex_trylock;
|
|
_pthread_atfork;
|
|
_pthread_barrier_destroy;
|
|
_pthread_barrier_init;
|
|
_pthread_barrier_wait;
|
|
_pthread_barrierattr_destroy;
|
|
_pthread_barrierattr_getpshared;
|
|
_pthread_barrierattr_init;
|
|
_pthread_barrierattr_setpshared;
|
|
_pthread_attr_destroy;
|
|
_pthread_attr_get_np;
|
|
_pthread_attr_getaffinity_np;
|
|
_pthread_attr_getdetachstate;
|
|
_pthread_attr_getguardsize;
|
|
_pthread_attr_getinheritsched;
|
|
_pthread_attr_getschedparam;
|
|
_pthread_attr_getschedpolicy;
|
|
_pthread_attr_getscope;
|
|
_pthread_attr_getstack;
|
|
_pthread_attr_getstackaddr;
|
|
_pthread_attr_getstacksize;
|
|
_pthread_attr_init;
|
|
_pthread_attr_setaffinity_np;
|
|
_pthread_attr_setcreatesuspend_np;
|
|
_pthread_attr_setdetachstate;
|
|
_pthread_attr_setguardsize;
|
|
_pthread_attr_setinheritsched;
|
|
_pthread_attr_setschedparam;
|
|
_pthread_attr_setschedpolicy;
|
|
_pthread_attr_setscope;
|
|
_pthread_attr_setstack;
|
|
_pthread_attr_setstackaddr;
|
|
_pthread_attr_setstacksize;
|
|
_pthread_cancel;
|
|
_pthread_cancel_enter;
|
|
_pthread_cancel_leave;
|
|
_pthread_cleanup_pop;
|
|
_pthread_cleanup_push;
|
|
_pthread_cond_broadcast;
|
|
_pthread_cond_destroy;
|
|
_pthread_cond_init;
|
|
_pthread_cond_signal;
|
|
_pthread_cond_timedwait;
|
|
_pthread_cond_wait;
|
|
_pthread_condattr_destroy;
|
|
_pthread_condattr_getclock;
|
|
_pthread_condattr_getpshared;
|
|
_pthread_condattr_init;
|
|
_pthread_condattr_setclock;
|
|
_pthread_condattr_setpshared;
|
|
_pthread_create;
|
|
_pthread_detach;
|
|
_pthread_equal;
|
|
_pthread_exit;
|
|
_pthread_getaffinity_np;
|
|
_pthread_getconcurrency;
|
|
_pthread_getcpuclockid;
|
|
_pthread_getprio;
|
|
_pthread_getschedparam;
|
|
_pthread_getspecific;
|
|
_pthread_getthreadid_np;
|
|
_pthread_join;
|
|
_pthread_key_create;
|
|
_pthread_key_delete;
|
|
_pthread_kill;
|
|
_pthread_main_np;
|
|
_pthread_multi_np;
|
|
_pthread_mutex_destroy;
|
|
_pthread_mutex_getprioceiling;
|
|
_pthread_mutex_getspinloops_np;
|
|
_pthread_mutex_getyieldloops_np;
|
|
_pthread_mutex_init;
|
|
_pthread_mutex_init_calloc_cb;
|
|
_pthread_mutex_isowned_np;
|
|
_pthread_mutex_lock;
|
|
_pthread_mutex_setprioceiling;
|
|
_pthread_mutex_setspinloops_np;
|
|
_pthread_mutex_setyieldloops_np;
|
|
_pthread_mutex_timedlock;
|
|
_pthread_mutex_trylock;
|
|
_pthread_mutex_unlock;
|
|
_pthread_mutexattr_destroy;
|
|
_pthread_mutexattr_getkind_np;
|
|
_pthread_mutexattr_getprioceiling;
|
|
_pthread_mutexattr_getprotocol;
|
|
_pthread_mutexattr_getpshared;
|
|
_pthread_mutexattr_gettype;
|
|
_pthread_mutexattr_init;
|
|
_pthread_mutexattr_setkind_np;
|
|
_pthread_mutexattr_setprioceiling;
|
|
_pthread_mutexattr_setprotocol;
|
|
_pthread_mutexattr_setpshared;
|
|
_pthread_mutexattr_settype;
|
|
_pthread_once;
|
|
_pthread_resume_all_np;
|
|
_pthread_resume_np;
|
|
_pthread_rwlock_destroy;
|
|
_pthread_rwlock_init;
|
|
_pthread_rwlock_rdlock;
|
|
_pthread_rwlock_timedrdlock;
|
|
_pthread_rwlock_timedwrlock;
|
|
_pthread_rwlock_tryrdlock;
|
|
_pthread_rwlock_trywrlock;
|
|
_pthread_rwlock_unlock;
|
|
_pthread_rwlock_wrlock;
|
|
_pthread_rwlockattr_destroy;
|
|
_pthread_rwlockattr_getpshared;
|
|
_pthread_rwlockattr_init;
|
|
_pthread_rwlockattr_setpshared;
|
|
_pthread_self;
|
|
_pthread_set_name_np;
|
|
_pthread_setaffinity_np;
|
|
_pthread_setcancelstate;
|
|
_pthread_setcanceltype;
|
|
_pthread_setconcurrency;
|
|
_pthread_setprio;
|
|
_pthread_setschedparam;
|
|
_pthread_setspecific;
|
|
_pthread_sigmask;
|
|
_pthread_single_np;
|
|
_pthread_spin_destroy;
|
|
_pthread_spin_init;
|
|
_pthread_spin_lock;
|
|
_pthread_spin_trylock;
|
|
_pthread_spin_unlock;
|
|
_pthread_suspend_all_np;
|
|
_pthread_suspend_np;
|
|
_pthread_switch_add_np;
|
|
_pthread_switch_delete_np;
|
|
_pthread_testcancel;
|
|
_pthread_timedjoin_np;
|
|
_pthread_yield;
|
|
|
|
/* Debugger needs these. */
|
|
_libthr_debug;
|
|
_thread_active_threads;
|
|
_thread_bp_create;
|
|
_thread_bp_death;
|
|
_thread_event_mask;
|
|
_thread_keytable;
|
|
_thread_last_event;
|
|
_thread_list;
|
|
_thread_max_keys;
|
|
_thread_off_attr_flags;
|
|
_thread_off_dtv;
|
|
_thread_off_event_buf;
|
|
_thread_off_event_mask;
|
|
_thread_off_key_allocated;
|
|
_thread_off_key_destructor;
|
|
_thread_off_linkmap;
|
|
_thread_off_next;
|
|
_thread_off_report_events;
|
|
_thread_off_state;
|
|
_thread_off_tcb;
|
|
_thread_off_tid;
|
|
_thread_off_tlsindex;
|
|
_thread_size_key;
|
|
_thread_state_running;
|
|
_thread_state_zoombie;
|
|
|
|
__pthread_map_stacks_exec;
|
|
};
|
|
|
|
FBSD_1.1 {
|
|
__pthread_cleanup_pop_imp;
|
|
__pthread_cleanup_push_imp;
|
|
pthread_attr_getaffinity_np;
|
|
pthread_attr_setaffinity_np;
|
|
pthread_getaffinity_np;
|
|
pthread_getcpuclockid;
|
|
pthread_setaffinity_np;
|
|
pthread_mutex_getspinloops_np;
|
|
pthread_mutex_getyieldloops_np;
|
|
pthread_mutex_isowned_np;
|
|
pthread_mutex_setspinloops_np;
|
|
pthread_mutex_setyieldloops_np;
|
|
};
|
|
|
|
FBSD_1.2 {
|
|
pthread_getthreadid_np;
|
|
};
|