From: Ben Hutchings Date: Mon, 24 Aug 2020 23:43:33 +0000 (+0100) Subject: [klibc] signal: Note another reason to define _KLIBC_NEEDS_SA_RESTORER X-Git-Tag: archive/raspbian/2.0.8-6+rpi1^2~11 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=22109d0800ae46324128cd8400960a75fbd99a26;p=klibc.git [klibc] signal: Note another reason to define _KLIBC_NEEDS_SA_RESTORER 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 Gbp-Pq: Name 0001-klibc-signal-Note-another-reason-to-define-_KLIBC_NE.patch --- diff --git a/usr/include/klibc/sysconfig.h b/usr/include/klibc/sysconfig.h index c91d5b8..4e38b1f 100644 --- a/usr/include/klibc/sysconfig.h +++ b/usr/include/klibc/sysconfig.h @@ -154,7 +154,8 @@ * * 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 diff --git a/usr/klibc/sigaction.c b/usr/klibc/sigaction.c index 19a8a54..37201f7 100644 --- a/usr/klibc/sigaction.c +++ b/usr/klibc/sigaction.c @@ -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; }