Skip to content

Commit

Permalink
new helper: restore_altstack()
Browse files Browse the repository at this point in the history
to be used by rt_sigreturn instances

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Dec 19, 2012
1 parent 031b656 commit 5c49574
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,6 @@ int unhandled_signal(struct task_struct *tsk, int sig);

void signals_init(void);

int restore_altstack(const stack_t __user *);

#endif /* _LINUX_SIGNAL_H */
7 changes: 7 additions & 0 deletions kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -3103,6 +3103,13 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s
return error;
}

int restore_altstack(const stack_t __user *uss)
{
int err = do_sigaltstack(uss, NULL, current_user_stack_pointer());
/* squash all but EFAULT for now */
return err == -EFAULT ? err : 0;
}

#ifdef __ARCH_WANT_SYS_SIGPENDING

/**
Expand Down

0 comments on commit 5c49574

Please sign in to comment.