klibc-bot for Ben Hutchings
2020-Aug-27 16:21 UTC
[klibc] [klibc:master] signal: Note another reason to define _KLIBC_NEEDS_SA_RESTORER
Commit-ID: ccc5c14c44f3fa76f61b8aae947cf3b853a6c833 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=ccc5c14c44f3fa76f61b8aae947cf3b853a6c833 Author: Ben Hutchings <ben at decadent.org.uk> AuthorDate: Tue, 25 Aug 2020 00:43:33 +0100 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Thu, 27 Aug 2020 15:00:33 +0100 [klibc] signal: Note another reason to define _KLIBC_NEEDS_SA_RESTORER 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 at decadent.org.uk> --- usr/include/klibc/sysconfig.h | 3 ++- usr/klibc/sigaction.c | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/usr/include/klibc/sysconfig.h b/usr/include/klibc/sysconfig.h index c91d5b85..4e38b1fd 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 30ef39ef..966bc1c6 100644 --- a/usr/klibc/sigaction.c +++ b/usr/klibc/sigaction.c @@ -31,8 +31,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; }
Possibly Parallel Threads
- [klibc:master] signal: Add sysconfig setting to force SA_SIGINFO on
- [klibc:master] alpha: Pass restorer to rt_sigaction() and disable executable stack
- [klibc:ia64-signal-fix] signal: Move rt_sigaction() argument mangling to arch directories
- [klibc:execstack-fixes] alpha: Set sa_restorer for signals and disable executable stack
- [klibc:execstack-fixes] alpha: Set sa_restorer for signals and disable executable stack