[klibc] alpha: Pass restorer to rt_sigaction() and disable executable stack
authorBen Hutchings <ben@decadent.org.uk>
Sun, 23 Aug 2020 14:18:19 +0000 (15:18 +0100)
committerThorsten Glaser <tg@mirbsd.de>
Wed, 26 May 2021 22:12:10 +0000 (23:12 +0100)
commitdf08ba6b23953343bbe2ba1a6138baf4f897ec03
tree22fecaa31f8a76c9df37dac974bbc3adb893c179
parentabc76ef852c35d85d923a127bcc41c1ec65f8257
[klibc] alpha: Pass restorer to rt_sigaction() and disable executable stack

Origin: https://git.kernel.org/pub/scm/libs/klibc/klibc.git/commit/?id=570ed1e207cbe38ed487c722f8ac7db68e664a94

alpha does not support the SA_RESTORER flag, but allows specifiying a
restorer callback as an additional parameter to rt_sigaction().  We
should do this to avoid needing an executable stack.

* Force the SA_SIGINFO flag on for all signal handlers, so that we can
  always return from them with rt_sigreturn
* Define a __sigreturn() routine that calls rt_sigreturn
* Pass that routine as the last argument to rt_sigaction()
* Set KLIBCEXECSTACK=n

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Name 0004-klibc-alpha-Pass-restorer-to-rt_sigaction-and-disabl.patch
usr/include/arch/alpha/klibc/archconfig.h
usr/klibc/arch/alpha/Kbuild
usr/klibc/arch/alpha/MCONFIG
usr/klibc/arch/alpha/sigreturn.S [new file with mode: 0644]
usr/klibc/sigaction.c