]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
new helper: restore_altstack()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 18 Nov 2012 20:29:16 +0000 (15:29 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 19 Dec 2012 23:07:40 +0000 (18:07 -0500)
to be used by rt_sigreturn instances

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
include/linux/signal.h
kernel/signal.c

index e19a011b43b7632163894ca70dde03ebaac64203..5969522136fee0985f42334a237ab2dc56adcefd 100644 (file)
@@ -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 */
index e75e4bd2839bba251306bcfa7c1eb2e05afb944e..887f2fefe207e171d2fbede1a7c651a4db66d674 100644 (file)
@@ -3103,6 +3103,13 @@ out:
        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
 
 /**