mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
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.
This commit is contained in:
committed by
Florian Weimer
parent
1ad4ba28e9
commit
2e6c45c59b
@ -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"
|
||||
|
@ -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"
|
||||
|
Reference in New Issue
Block a user