aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/signal_32.c9
-rw-r--r--arch/x86/kernel/signal_64.c15
2 files changed, 24 insertions, 0 deletions
diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
index 0ff8d8750a7d..d9909881ac66 100644
--- a/arch/x86/kernel/signal_32.c
+++ b/arch/x86/kernel/signal_32.c
@@ -125,6 +125,7 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
125 return ret; 125 return ret;
126} 126}
127 127
128#ifdef CONFIG_X86_32
128asmlinkage int sys_sigaltstack(unsigned long bx) 129asmlinkage int sys_sigaltstack(unsigned long bx)
129{ 130{
130 /* 131 /*
@@ -137,6 +138,14 @@ asmlinkage int sys_sigaltstack(unsigned long bx)
137 138
138 return do_sigaltstack(uss, uoss, regs->sp); 139 return do_sigaltstack(uss, uoss, regs->sp);
139} 140}
141#else /* !CONFIG_X86_32 */
142asmlinkage long
143sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
144 struct pt_regs *regs)
145{
146 return do_sigaltstack(uss, uoss, regs->sp);
147}
148#endif /* CONFIG_X86_32 */
140 149
141#define COPY(x) { \ 150#define COPY(x) { \
142 err |= __get_user(regs->x, &sc->x); \ 151 err |= __get_user(regs->x, &sc->x); \
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index c52244ac19fc..b6e4fe03a36b 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -50,12 +50,27 @@
50# define FIX_EFLAGS __FIX_EFLAGS 50# define FIX_EFLAGS __FIX_EFLAGS
51#endif 51#endif
52 52
53#ifdef CONFIG_X86_32
54asmlinkage int sys_sigaltstack(unsigned long bx)
55{
56 /*
57 * This is needed to make gcc realize it doesn't own the
58 * "struct pt_regs"
59 */
60 struct pt_regs *regs = (struct pt_regs *)&bx;
61 const stack_t __user *uss = (const stack_t __user *)bx;
62 stack_t __user *uoss = (stack_t __user *)regs->cx;
63
64 return do_sigaltstack(uss, uoss, regs->sp);
65}
66#else /* !CONFIG_X86_32 */
53asmlinkage long 67asmlinkage long
54sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, 68sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
55 struct pt_regs *regs) 69 struct pt_regs *regs)
56{ 70{
57 return do_sigaltstack(uss, uoss, regs->sp); 71 return do_sigaltstack(uss, uoss, regs->sp);
58} 72}
73#endif /* CONFIG_X86_32 */
59 74
60#define COPY(x) { \ 75#define COPY(x) { \
61 err |= __get_user(regs->x, &sc->x); \ 76 err |= __get_user(regs->x, &sc->x); \