summaryrefslogtreecommitdiff
path: root/src/internal/ksigaction.h
AgeCommit message (Collapse)AuthorLines
2023-02-09fix wrong sigaction syscall ABI on mips*, or1k, microblaze, riscv64Rich Felker-0/+5
we wrongly defined a dummy SA_RESTORER flag on these archs, despite the kernel interface not actually having such a feature. on archs which lack SA_RESTORER, the kernel sigaction structure also lacks the restorer function pointer member, which means the signal mask appears at a different offset. the kernel was thereby interpreting the bits of the code address as part of the signal set to be masked while handling the signal. this patch removes the erroneous SA_RESTORER definitions from archs which do not have it, makes access to the member conditional on whether SA_RESTORER is defined for the arch, and removes the now-unused asm for the affected archs. because there are reportedly versions of qemu-user which also use the wrong ABI here, the old ksigaction struct size is preserved with an unused member at the end. this is harmless and mitigates the risk of such a bug turning into a buffer overflow onto the sigaction function's stack.
2018-09-12apply hidden visibility to sigreturn code fragmentsRich Felker-1/+3
these were overlooked in the declarations overhaul work because they are not properly declared, and the current framework even allows their declared types to vary by arch. at some point this should be cleaned up, but I'm not sure what the right way would be.
2015-09-23fix signal return for sh/fdpicRich Felker-0/+2
the restorer function pointer provided in the kernel sigaction structure is interpreted by the kernel as a raw code address, not a function descriptor. this commit moves the declarations of the __restore and __restore_rt symbols to ksigaction.h so that arch versions of the file can override them, and introduces a version for sh which declares them as objects rather than functions. an alternate solution would have been defining SA_RESTORER to 0 so that the functions are not used, but this both requires executable stack (since the sh kernel does not have a vdso page with permanent restorer functions) and crashes on qemu user-level emulation.
2013-06-29add some comments about the mips ksigaction structure weirdnessRich Felker-0/+3
2012-07-12fix breakage of x86_64 sigaction from recent changes for mipsRich Felker-1/+1
2012-07-11use unsigned bitmask for consistency in ksigactionRich Felker-1/+1
the type doesn't actually matter, just the size, but it's nice to be consistent...
2012-07-11fix breakage from last commit: forgot to include ksigaction.hRich Felker-0/+6
this file can be overridden by a same-named file in an arch dir.