[klibc] signal: Note another reason to define _KLIBC_NEEDS_SA_RESTORER
authorBen Hutchings <ben@decadent.org.uk>
Mon, 24 Aug 2020 23:43:33 +0000 (00:43 +0100)
committerThorsten Glaser <tg@mirbsd.de>
Wed, 26 May 2021 22:12:10 +0000 (23:12 +0100)
Origin: https://git.kernel.org/pub/scm/libs/klibc/klibc.git/commit/?id=ccc5c14c44f3fa76f61b8aae947cf3b853a6c833

On some architectures we should set SA_RESTORER to avoid the need for
a signal trampoline and executable stack.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Name 0001-klibc-signal-Note-another-reason-to-define-_KLIBC_NE.patch

usr/include/klibc/sysconfig.h
usr/klibc/sigaction.c

index c91d5b85a31059577e0a0b5f5e66ef4c250c1a23..4e38b1fd1e1dddf522892311a6d42dcef18295a0 100644 (file)
  *
  *     Some architectures, like x86-64 and some i386 Fedora kernels,
  *     do not provide a default sigreturn, and therefore must have
- *     SA_RESTORER set.
+ *     SA_RESTORER set.  On others, the default sigreturn requires an
+ *     executable stack, which we should avoid.
  */
 #ifndef _KLIBC_NEEDS_SA_RESTORER
 # define _KLIBC_NEEDS_SA_RESTORER 0
index 19a8a54b8f3ef889e4010d730206353ed562e3ec..37201f7df3747b90b36cb3ce8232e889d47972af 100644 (file)
@@ -30,8 +30,6 @@ int sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
                sa = *act;
                act = &sa;
 
-               /* The kernel can't be trusted to have a valid default
-                  restorer */
                sa.sa_flags |= SA_RESTORER;
                sa.sa_restorer = &__sigreturn;
        }