Commit 2bcdebe4 authored by Linus Torvalds's avatar Linus Torvalds

Re-instate the SA_RESTORER functionality, since it seems that some

programs still depend on it and in fact do install a different signal
restorer than the standard kernel version.
parent d5a9a399
......@@ -350,6 +350,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
static void setup_frame(int sig, struct k_sigaction *ka,
sigset_t *set, struct pt_regs * regs)
{
void *restorer;
struct sigframe *frame;
int err = 0;
......@@ -378,8 +379,12 @@ static void setup_frame(int sig, struct k_sigaction *ka,
if (err)
goto give_sigsegv;
restorer = (void *) (fix_to_virt(FIX_VSYSCALL) + 32);
if (ka->sa.sa_flags & SA_RESTORER)
restorer = ka->sa.sa_restorer;
/* Set up to return from userspace. */
err |= __put_user(fix_to_virt(FIX_VSYSCALL) + 32, &frame->pretcode);
err |= __put_user(restorer, &frame->pretcode);
/*
* This is popl %eax ; movl $,%eax ; int $0x80
......@@ -422,6 +427,7 @@ static void setup_frame(int sig, struct k_sigaction *ka,
static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *set, struct pt_regs * regs)
{
void *restorer;
struct rt_sigframe *frame;
int err = 0;
......@@ -456,7 +462,10 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
goto give_sigsegv;
/* Set up to return from userspace. */
err |= __put_user(fix_to_virt(FIX_VSYSCALL) + 64, &frame->pretcode);
restorer = (void *) (fix_to_virt(FIX_VSYSCALL) + 64);
if (ka->sa.sa_flags & SA_RESTORER)
restorer = ka->sa.sa_restorer;
err |= __put_user(restorer, &frame->pretcode);
/*
* This is movl $,%eax ; int $0x80
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment