| Commit message (Expand) | Author | Age | Files | Lines |
| * | fix crash in x32 sigsetjmp•••the 64-bit push reads not only the 32-bit return address but also the
first 32 signal mask bits. if any were nonzero, the return address
obtained will be invalid.
at some point storage of the return address should probably be moved
to follow the saved mask so that there's plenty room and the same code
can be used on x32 and regular x86_64, but for now I want a fix that
does not risk breaking x86_64, and this simple re-zeroing works.
| Rich Felker | 2015-05-02 | 1 | -0/+1 |
| * | remove potentially PIC-incompatible relocations from x86_64 and x32 asm•••analogous to commit 8ed66ecbcba1dd0f899f22b534aac92a282f42d5 for i386.
| Rich Felker | 2015-04-18 | 1 | -2/+2 |
| * | redesign sigsetjmp so that signal mask is restored after longjmp•••the conventional way to implement sigsetjmp is to save the signal mask
then tail-call to setjmp; siglongjmp then restores the signal mask and
calls longjmp. the problem with this approach is that a signal already
pending, or arriving between unmasking of signals and restoration of
the saved stack pointer, will have its signal handler run on the stack
that was active before siglongjmp was called. this can lead to
unbounded stack usage when siglongjmp is used to leave a signal
handler.
in the new design, sigsetjmp saves its own return address inside the
extended part of the sigjmp_buf (outside the __jmp_buf part used by
setjmp) then calls setjmp to save a jmp_buf inside its own execution.
it then tail-calls to __sigsetjmp_tail, which uses the return value of
setjmp to determine whether to save the current signal mask or restore
a previously-saved mask.
as an added bonus, this design makes it so that siglongjmp and longjmp
are identical. this is useful because the __longjmp_chk function we
need to add for ABI-compatibility assumes siglongjmp and longjmp are
the same, but for different reasons -- it was designed assuming either
can access a flag just past the __jmp_buf indicating whether the
signal masked was saved, and act on that flag. however, early versions
of musl did not have space past the __jmp_buf for the non-sigjmp_buf
version of jmp_buf, so our setjmp cannot store such a flag without
risking clobbering memory on (very) old binaries.
| Rich Felker | 2015-04-17 | 1 | -9/+16 |
| * | add __sigsetjmp ABI-compat alias for sigsetjmp | Rich Felker | 2014-04-02 | 1 | -0/+3 |
| * | x32 port (diff against vanilla x86_64) | rofl0r | 2014-02-23 | 1 | -1/+1 |
| * | import vanilla x86_64 code as x32 | rofl0r | 2014-02-23 | 2 | -0/+22 |