#
2c444fdb |
| 10-Jul-2025 |
Jessica Clarke <jrtc27@FreeBSD.org> |
libc,libthr: Remove __pthread_distribute_static_tls
This private API is no longer used by rtld-elf so can be removed.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D50921
|
Revision tags: release/14.3.0-p1, release/14.2.0-p4, release/13.5.0-p2, release/14.3.0 |
|
#
6b96e7a5 |
| 01-Jun-2025 |
Konstantin Belousov <kib@FreeBSD.org> |
libthr/amd64: do not set THR_C_RUNTIME for thr_new() if the main thread did used AMD64_SET_TLSBASE
It is up to the code that organizes the runtime to properly set the signal handler, and to set %fsb
libthr/amd64: do not set THR_C_RUNTIME for thr_new() if the main thread did used AMD64_SET_TLSBASE
It is up to the code that organizes the runtime to properly set the signal handler, and to set %fsbase if libthr signal handler is to be called. The change should leave the CPU state on the signal handler entry identical to what it was before introduction of TLSBASE, for code that provides its own startup and thread pointer, but still calls into libthr as a hack.
Sponsored by: The FreeBSD Foundation MFC after: 1 week
show more ...
|
#
b9c8a07d |
| 23-May-2025 |
Konstantin Belousov <kib@FreeBSD.org> |
C runtime: enable extended error reporting from kernel
Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D50483
|
#
846229d6 |
| 24-Apr-2025 |
Konstantin Belousov <kib@FreeBSD.org> |
libthr: add __thr_aligned_alloc_offset()
Sponsored by: The FreeBSD Foundation MFC after: 1 week
|
Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3 |
|
#
86f6ff9f |
| 24-Dec-2024 |
Konstantin Belousov <kib@FreeBSD.org> |
libthr: move dlerror_msg into zeroed part of struct thread
struct thread reuse might cause stalled rtld error message to propagate to the new thread.
Reviewed by: markj Sponsored by: The FreeBSD Fo
libthr: move dlerror_msg into zeroed part of struct thread
struct thread reuse might cause stalled rtld error message to propagate to the new thread.
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48200
show more ...
|
Revision tags: release/14.2.0 |
|
#
83aafcdc |
| 14-Nov-2024 |
Kyle Evans <kevans@FreeBSD.org> |
libc, libthr: coordinate stubs for pthread_{suspend,resume}_all_np
If libthr isn't linked into the process, then we don't have any pthreads to worry about and our stubs can just return success -- th
libc, libthr: coordinate stubs for pthread_{suspend,resume}_all_np
If libthr isn't linked into the process, then we don't have any pthreads to worry about and our stubs can just return success -- there are none to suspend/resume.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D47350
show more ...
|
Revision tags: release/13.4.0 |
|
#
5670b8cc |
| 24-Jul-2024 |
Michal Meloun <mmel@FreeBSD.org> |
libthr: Preresolve selected EABI symbols on arm.
Add the ability to pre-resolve architecture-specific EABI symbols and use it on arm for selected EABI functions. These functions can be called with r
libthr: Preresolve selected EABI symbols on arm.
Add the ability to pre-resolve architecture-specific EABI symbols and use it on arm for selected EABI functions. These functions can be called with rtld bind lock write-locked, so they should be resolved in forward.
Reported by: Mark Millard <marklmi@yahoo.com>, John F Carr <jfc@mit.edu> Reviewed by: kib, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46104
show more ...
|
Revision tags: release/14.1.0 |
|
#
ec2b6b16 |
| 08-May-2024 |
Brooks Davis <brooks@FreeBSD.org> |
libthr: avoid varargs in fcntl and openat interposers
Align these signatures with the ones in syscalls.master (and thus libsys.h). There's no reason to do va_args twice and in some ABIs (e.g,, Cher
libthr: avoid varargs in fcntl and openat interposers
Align these signatures with the ones in syscalls.master (and thus libsys.h). There's no reason to do va_args twice and in some ABIs (e.g,, CheriABI) you can't access fixed arguments as varargs if you weren't called with varargs signature.
Reviewed by: imp, kib, jhibbits Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D45126
show more ...
|
#
220aa0f4 |
| 19-Apr-2024 |
Konstantin Belousov <kib@FreeBSD.org> |
libthr: add pthread_sigqueue(3)
PR: 278459 Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44867
|
#
f8bbbce4 |
| 06-Mar-2024 |
Konstantin Belousov <kib@FreeBSD.org> |
libthr: remove explicit sys/cdefs.h includes
Sponsored by: The FreeBSD Foundation MFC after: 1 week
|
Revision tags: release/13.3.0 |
|
#
aadb4a1b |
| 04-Jan-2024 |
Olivier Certner <olce@FreeBSD.org> |
pthread_attr_get_np(): Use malloc(), report ENOMEM, don't tamper on error
Similarly as in the previous commit, using calloc() instead of malloc() is useless here in the regular case since the subseq
pthread_attr_get_np(): Use malloc(), report ENOMEM, don't tamper on error
Similarly as in the previous commit, using calloc() instead of malloc() is useless here in the regular case since the subsequent call to cpuset_getaffinify() is going to completely fill the allocated memory.
However, there is an additional complication. This function tries to allocate memory to hold the cpuset if it previously wasn't, and does so before the thread lock is acquired, which can fail on a bad thread ID. In this case, it is necessary to deallocate the memory allocated in this function so that the attributes object appears unmodified to the caller when an error is returned. Without this, a subsequent call to pthread_attr_getaffinity_np() would expose uninitialized memory (not a security problem per se, since it comes from the same process) instead of returning a full mask as it would before the failing call to pthread_attr_get_np(). So the caller would be able to notice a change in the state of the attributes object even if pthread_attr_get_np() reported failure, which would be quite surprising. A similar problem that could occur on failure of cpuset_setaffinity() has been fixed.
Finally, we shall always report memory allocation failure. This already goes for pthread_attr_init(), so, if for nothing else, just be consistent.
Reviewed by: emaste, kib Approved by: emaste (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43329
show more ...
|
Revision tags: release/14.0.0 |
|
#
0dc52b72 |
| 15-Aug-2023 |
Minsoo Choo <minsoochoo0122@proton.me> |
libc: export pthread_getname_np stub
pthread_getname_np needs to be provided by libc in order to import jemalloc 5.3.0.
A stub implementation for libc pthread_getname_np() is added for _pthread_stu
libc: export pthread_getname_np stub
pthread_getname_np needs to be provided by libc in order to import jemalloc 5.3.0.
A stub implementation for libc pthread_getname_np() is added for _pthread_stubs.c, which always reports empty name for the main thread.
Internal _pthread_getname_np() is not exported, but provided for libc own use.
Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41461
show more ...
|
#
b3e76948 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
#
6f49eafb |
| 20-May-2023 |
Konstantin Belousov <kib@FreeBSD.org> |
libthr rtld locks: do not leak URWLOCK_READ_WAITERS into child
Since there is only the current thread in the child, no pending readers exist. Clear the bit, since it confuses future attempts to acq
libthr rtld locks: do not leak URWLOCK_READ_WAITERS into child
Since there is only the current thread in the child, no pending readers exist. Clear the bit, since it confuses future attempts to acquire write ownership of the rtld locks, due to URWLOCK_PREFER_READERS flag.
To be future-proof, clear all state about pending writers and readers.
PR: 271490 Reported and tested by: KJ Tsanaktsidis <kj@kjtsanaktsidis.id.au> Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D40178
show more ...
|
#
4d846d26 |
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
Revision tags: release/13.2.0, release/12.4.0 |
|
#
e03c7f50 |
| 14-Sep-2022 |
Konstantin Belousov <kib@FreeBSD.org> |
libthr: extract code to get main stack base and size into helpers
Reviewed by: brooks, imp (previous version) Discussed with: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differenti
libthr: extract code to get main stack base and size into helpers
Reviewed by: brooks, imp (previous version) Discussed with: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36540
show more ...
|
Revision tags: release/13.1.0 |
|
#
f75b1ff6 |
| 17-Jan-2022 |
Mark Johnston <markj@FreeBSD.org> |
Revert "libthr: Use kern.stacktop for thread stack calculation."
The current ASLR stack gap feature will be removed, and with that the need for this change, and the kern.stactop sysctl, is gone. Mo
Revert "libthr: Use kern.stacktop for thread stack calculation."
The current ASLR stack gap feature will be removed, and with that the need for this change, and the kern.stactop sysctl, is gone. Moreover, the approach taken in this revision does not provide compatibility for old copies of libthr.so, and the revision should have also updated __libc_map_stacks_exec().
This reverts commit 78df56ccfcb40013a3e6904bd6d39836220c3550.
Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33704
show more ...
|
Revision tags: release/12.3.0 |
|
#
78df56cc |
| 13-Oct-2021 |
Dawid Gorecki <dgr@semihalf.com> |
libthr: Use kern.stacktop for thread stack calculation.
Use the new kern.stacktop sysctl to retrieve the address of stack top instead of kern.usrstack. kern.usrstack does not have any knowledge of t
libthr: Use kern.stacktop for thread stack calculation.
Use the new kern.stacktop sysctl to retrieve the address of stack top instead of kern.usrstack. kern.usrstack does not have any knowledge of the stack gap, so this can cause problems with thread stacks. Using kern.stacktop sysctl should fix most of those problems. kern.usrstack is used as a fallback when kern.stacktop cannot be read.
Rename usrstack variables to stacktop to reflect this change.
Fixes problems with firefox and thunderbird not starting with stack gap enabled.
PR: 239873 Reviewed by: kib Obtained from: Semihalf Sponsored by: Stormshield MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D31898
show more ...
|
Revision tags: release/13.0.0 |
|
#
4d9128da |
| 08-Apr-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
rtld: make dlerror() thread-local
PR: 95339 Discussed with: arichardson Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29633
|
#
21f749da |
| 10-Jan-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
libthr: wrap pdfork(2), same as fork(2).
Without wrapping, rtld services and malloc(3) are not guaranteed to operate correctly in the forked child.
Reviewed by: markj MFC after: 1 week Sponsored by
libthr: wrap pdfork(2), same as fork(2).
Without wrapping, rtld services and malloc(3) are not guaranteed to operate correctly in the forked child.
Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28088
show more ...
|
Revision tags: release/12.2.0, release/11.4.0 |
|
#
44e86fbd |
| 13-Feb-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r357662 through r357854.
|
#
fc908e50 |
| 09-Feb-2020 |
Konstantin Belousov <kib@FreeBSD.org> |
Use sigfastblock(2) for masking signals in libthr.
Ensure proper handshake to transfer sigfastblock(2) blocking word ownership from rtld to libthr.
Unfortunately sigfastblock(2) is not enough to st
Use sigfastblock(2) for masking signals in libthr.
Ensure proper handshake to transfer sigfastblock(2) blocking word ownership from rtld to libthr.
Unfortunately sigfastblock(2) is not enough to stop intercepting signals in libthr, because critical sections must ensure more than just signal blocking.
Tested by: pho Disscussed with: cem, emaste, jilles Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D12773
show more ...
|
Revision tags: release/12.1.0 |
|
#
c5c3ba6b |
| 03-Sep-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r351317 through r351731.
|
#
65174f68 |
| 21-Aug-2019 |
Konstantin Belousov <kib@FreeBSD.org> |
Fix _pthread_cancel_enter() and _pthread_cancel_leave() jmptable entries.
PR: 240022 Reported by: Andrew Gierth <andrew@tao11.riddles.org.uk> Sponsored by: The FreeBSD Foundation MFC after: 3 days
|
#
3638455c |
| 31-Jul-2019 |
Konstantin Belousov <kib@FreeBSD.org> |
Avoid conflicts with libc symbols in libthr jump table.
In some corner cases of static linking and unexpected libraries order on the linker command line, libc symbol might preempt the same libthr sy
Avoid conflicts with libc symbols in libthr jump table.
In some corner cases of static linking and unexpected libraries order on the linker command line, libc symbol might preempt the same libthr symbol, in which case libthr jump table points back to libc causing either infinite recursion or loop. Handle all of such symbols by using private libthr names for them, ensuring that the right pointers are installed into the table.
In collaboration with: arichardson PR: 239475 Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D21088
show more ...
|