| Commit message (Expand) | Author | Age | Files | Lines |
| * | update license of njk contributed code (x86_64 asm)•••these changes are based on the following communication via email:
"I hereby grant that all of the code I have contributed to musl on or
before April 23, 2012 may be licensed under the terms of the following
MIT license:
Copyright (c) 2011-2012 Nicholas J. Kain
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
| Rich Felker | 2012-05-05 | 1 | -1/+1 |
| * | work around "signal loses thread pointer" issue with "approach 2"•••this was discussed on the mailing list and no consensus on the
preferred solution was reached, so in anticipation of a release, i'm
just committing a minimally-invasive solution that avoids the problem
by ensuring that multi-threaded-capable programs will always have
initialized the thread pointer before any signal handler can run.
in the long term we may switch to initializing the thread pointer at
program start time whenever the program has the potential to access
any per-thread data.
| Rich Felker | 2012-02-27 | 1 | -0/+5 |
| * | initial commit of the arm port•••this port assumes eabi calling conventions, eabi linux syscall
convention, and presence of the kernel helpers at 0xffff0f?0 needed
for threads support. otherwise it makes very few assumptions, and the
code should work even on armv4 without thumb support, as well as on
systems with thumb interworking. the bits headers declare this a
little endian system, but as far as i can tell the code should work
equally well on big endian.
some small details are probably broken; so far, testing has been
limited to qemu/aboriginal linux.
| Rich Felker | 2011-09-18 | 1 | -0/+11 |
| * | fix generic sigsetjmp (unused anyway) pointer signedness error | Rich Felker | 2011-09-16 | 1 | -1/+1 |
| * | implement gnu sigisemptyset | Rich Felker | 2011-09-12 | 1 | -0/+9 |
| * | fix missing prototypes/wrong signature for psiginfo, psignal | Rich Felker | 2011-09-02 | 1 | -1/+1 |
| * | fix off-by-one bug in siglongjmp that caused unpredictable behavior•••if saved, signal mask would not be restored unless some low signals
were masked. if not saved, signal mask could be wrongly restored to
uninitialized values. in any, wrong mask would be restored.
i believe this function was written for a very old version of the
jmp_buf structure which did not contain a final 0 field for
compatibility with siglongjmp, and never updated...
| Rich Felker | 2011-08-05 | 1 | -1/+1 |
| * | fix race condition in sigqueue•••this race is fundamentally due to linux's bogus requirement that
userspace, rather than kernelspace, fill in the siginfo structure. an
intervening signal handler that calls fork could cause both the parent
and child process to send signals claiming to be from the parent,
which could in turn have harmful effects depending on what the
recipient does with the signal. we simply block all signals for the
interval between getuid and sigqueue syscalls (much like what raise()
does already) to prevent the race and make the getuid/sigqueue pair
atomic.
this will be a non-issue if linux is fixed to validate the siginfo
structure or fill it in from kernelspace.
| Rich Felker | 2011-07-30 | 1 | -2/+8 |
| * | clean up pthread_sigmask/sigprocmask dependency order•••it's nicer for the function that doesn't use errno to be independent,
and have the other one call it. saves some time and avoids clobbering
errno.
| Rich Felker | 2011-07-30 | 1 | -8/+4 |
| * | restore use of .type in asm, but use modern @function (vs %function)•••this seems to be necessary to make the linker accept the functions in
a shared library (perhaps to generate PLT entries?)
strictly speaking libc-internal asm should not need it. i might clean
that up later.
| Rich Felker | 2011-06-14 | 4 | -0/+6 |
| * | remove all .size and .type directives for functions from the asm•••these are useless and have caused problems for users trying to build
with non-gnu tools like tcc's assembler.
| Rich Felker | 2011-06-13 | 2 | -10/+0 |
| * | implement psignal and psiginfo | Rich Felker | 2011-06-08 | 2 | -0/+20 |
| * | overhaul implementation-internal signal protections•••the new approach relies on the fact that the only ways to create
sigset_t objects without invoking UB are to use the sig*set()
functions, or from the masks returned by sigprocmask, sigaction, etc.
or in the ucontext_t argument to a signal handler. thus, as long as
sigfillset and sigaddset avoid adding the "protected" signals, there
is no way the application will ever obtain a sigset_t including these
bits, and thus no need to add the overhead of checking/clearing them
when sigprocmask or sigaction is called.
note that the old code actually *failed* to remove the bits from
sa_mask when sigaction was called.
the new implementations are also significantly smaller, simpler, and
faster due to ignoring the useless "GNU HURD signals" 65-1024, which
are not used and, if there's any sanity in the world, never will be
used.
| Rich Felker | 2011-05-07 | 8 | -29/+18 |
| * | overhaul pthread cancellation•••this patch improves the correctness, simplicity, and size of
cancellation-related code. modulo any small errors, it should now be
completely conformant, safe, and resource-leak free.
the notion of entering and exiting cancellation-point context has been
completely eliminated and replaced with alternative syscall assembly
code for cancellable syscalls. the assembly is responsible for setting
up execution context information (stack pointer and address of the
syscall instruction) which the cancellation signal handler can use to
determine whether the interrupted code was in a cancellable state.
these changes eliminate race conditions in the previous generation of
cancellation handling code (whereby a cancellation request received
just prior to the syscall would not be processed, leaving the syscall
to block, potentially indefinitely), and remedy an issue where
non-cancellable syscalls made from signal handlers became cancellable
if the signal handler interrupted a cancellation point.
x86_64 asm is untested and may need a second try to get it right.
| Rich Felker | 2011-04-17 | 2 | -12/+3 |
| * | use a separate signal from SIGCANCEL for SIGEV_THREAD timers•••otherwise we cannot support an application's desire to use
asynchronous cancellation within the callback function. this change
also slightly debloats pthread_create.c.
| Rich Felker | 2011-04-14 | 3 | -2/+3 |
| * | fix broken sigsetjmp on x86_64 | Rich Felker | 2011-04-08 | 1 | -7/+9 |
| * | consistency: change all remaining syscalls to use SYS_ rather than __NR_ prefix | Rich Felker | 2011-04-06 | 3 | -3/+3 |
| * | fix all implicit conversion between signed/unsigned pointers•••sadly the C language does not specify any such implicit conversion, so
this is not a matter of just fixing warnings (as gcc treats it) but
actual errors. i would like to revisit a number of these changes and
possibly revise the types used to reduce the number of casts required.
| Rich Felker | 2011-03-25 | 1 | -1/+1 |
| * | overhaul cancellation to fix resource leaks and dangerous behavior with signals•••this commit addresses two issues:
1. a race condition, whereby a cancellation request occurring after a
syscall returned from kernelspace but before the subsequent
CANCELPT_END would cause cancellable resource-allocating syscalls
(like open) to leak resources.
2. signal handlers invoked while the thread was blocked at a
cancellation point behaved as if asynchronous cancellation mode wer in
effect, resulting in potentially dangerous state corruption if a
cancellation request occurs.
the glibc/nptl implementation of threads shares both of these issues.
with this commit, both are fixed. however, cancellation points
encountered in a signal handler will not be acted upon if the signal
was received while the thread was already at a cancellation point.
they will of course be acted upon after the signal handler returns, so
in real-world usage where signal handlers quickly return, it should
not be a problem. it's possible to solve this problem too by having
sigaction() wrap all signal handlers with a function that uses a
pthread_cleanup handler to catch cancellation, patch up the saved
context, and return into the cancellable function that will catch and
act upon the cancellation. however that would be a lot of complexity
for minimal if any benefit...
| Rich Felker | 2011-03-24 | 2 | -0/+2 |
| * | global cleanup to use the new syscall interface | Rich Felker | 2011-03-20 | 8 | -23/+10 |
| * | syscall overhaul part two - unify public and internal syscall interface•••with this patch, the syscallN() functions are no longer needed; a
variadic syscall() macro allows syscalls with anywhere from 0 to 6
arguments to be made with a single macro name. also, manually casting
each non-integer argument with (long) is no longer necessary; the
casts are hidden in the macros.
some source files which depended on being able to define the old macro
SYSCALL_RETURNS_ERRNO have been modified to directly use __syscall()
instead of syscall(). references to SYSCALL_SIGSET_SIZE and SYSCALL_LL
have also been changed.
x86_64 has not been tested, and may need a follow-up commit to fix any
minor bugs/oversights.
| Rich Felker | 2011-03-19 | 3 | -3/+3 |
| * | fix errors in sigqueue (potential information leak, wrong behavior)•••1. any padding in the siginfo struct was not necessarily zero-filled,
so it might have contained private data off the caller's stack.
2. the uid and pid must be filled in from userspace. the previous
rsyscall fix broke rsyscalls because the values were always incorrect.
| Rich Felker | 2011-03-10 | 1 | -5/+7 |
| * | remove useless return value checks for functions that cannot fail | Rich Felker | 2011-03-10 | 1 | -3/+2 |
| * | make sigsuspend a cancellation point | Rich Felker | 2011-03-10 | 1 | -1/+6 |
| * | make sigtimedwait a cancellation point | Rich Felker | 2011-03-10 | 1 | -0/+3 |
| * | don't fail with EINTR in sigtimedwait•••POSIX allows either behavior, but sigwait is not allowed to fail with
EINTR, so the retry loop would have to be in one or the other anyway.
| Rich Felker | 2011-03-10 | 1 | -6/+6 |
| * | fix sigsuspend syscall | Rich Felker | 2011-03-10 | 1 | -1/+1 |
| * | make sigaltstack work (missing macros in signal.h, error conditions) | Rich Felker | 2011-03-10 | 1 | -1/+11 |
| * | fix error handling for pthread_sigmask•••it must return errno, not -1, and should reject invalud values for how.
| Rich Felker | 2011-03-09 | 1 | -1/+5 |
| * | fix race condition in raise - just mask signals•••a signal handler could fork after the pid/tid were read, causing the
wrong process to be signalled. i'm not sure if this is supposed to
have UB or not, but raise is async-signal-safe, so it probably is
allowed. the current solution is slightly expensive so this
implementation is likely to be changed in the future.
| Rich Felker | 2011-03-09 | 1 | -9/+9 |
| * | fix raise semantics with threads. | Rich Felker | 2011-03-09 | 1 | -1/+12 |
| * | fix null pointer dereference introduced in last sigprocmask commit | Rich Felker | 2011-02-20 | 1 | -1/+1 |
| * | prevent sigprocmask/pthread_sigmask from blocking implementation signals•••this code was wrongly disabled because the old version was trying to
be too clever and didn't work. replaced it with a simple version for
now.
| Rich Felker | 2011-02-19 | 1 | -3/+5 |
| * | Port musl to x86-64. One giant commit! | Nicholas J. Kain | 2011-02-15 | 2 | -0/+22 |
| * | header cleanup, conformance fixes - signals | Rich Felker | 2011-02-14 | 2 | -6/+3 |
| * | fix previous commit that broke sigreturn. looks like the asm is needed. | Rich Felker | 2011-02-13 | 3 | -5/+17 |
| * | fix omission that kept sa_restorer from being used | Rich Felker | 2011-02-13 | 1 | -1/+1 |
| * | initial check-in, version 0.5.0 | Rich Felker | 2011-02-12 | 32 | -0/+398 |