diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2016-12-26 10:09:06 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2016-12-26 10:11:06 +0100 |
commit | 2e6c45c59bcd40f1ae8466cbd32f4d263ff45619 (patch) | |
tree | fc558d3f90670cf9028bfd33839dbe75c2d674bb /sysdeps/unix/sysv/linux | |
parent | 1ad4ba28e9335c288687d1757bce3221c522f576 (diff) | |
download | glibc-2e6c45c59bcd40f1ae8466cbd32f4d263ff45619.tar.gz glibc-2e6c45c59bcd40f1ae8466cbd32f4d263ff45619.tar.xz glibc-2e6c45c59bcd40f1ae8466cbd32f4d263ff45619.zip |
Do not stack-protect sigreturn stubs [BZ #7065]
These are called from the kernel with the stack at a carefully- chosen location so that the stack frame can be restored: they must not move the stack pointer lest garbage be restored into the registers. We explicitly inhibit protection for SPARC and for signal/sigreturn.c: other arches either define their sigreturn stubs in .S files, or (i386, x86_64, mips) use macros expanding to top-level asm blocks and explicit labels in the text section to mock up a "function" without telling the compiler that one is there at all.
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c | 8 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c index 5aa3c3516e..b75142fc6b 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c @@ -65,7 +65,9 @@ libc_hidden_def (__libc_sigaction) #include <nptl/sigaction.c> -static void +static +inhibit_stack_protector +void __rt_sigreturn_stub (void) { __asm__ ("mov %0, %%g1\n\t" @@ -74,7 +76,9 @@ __rt_sigreturn_stub (void) : "i" (__NR_rt_sigreturn)); } -static void +static +inhibit_stack_protector +void __sigreturn_stub (void) { __asm__ ("mov %0, %%g1\n\t" diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c b/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c index 50c444c72d..058c011449 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c @@ -66,7 +66,9 @@ libc_hidden_def (__libc_sigaction) #include <nptl/sigaction.c> -static void +static +inhibit_stack_protector +void __rt_sigreturn_stub (void) { __asm__ ("mov %0, %%g1\n\t" |