diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-14 14:47:53 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-19 18:07:41 -0500 |
commit | 9026843952adac5b123c7b8dc961e5c15828d9e1 (patch) | |
tree | 4ef89cf05cf97427ceb2587fed94a6a12833d527 /arch/x86/ia32 | |
parent | 6bf9adfc90370b695cb111116e15fdc0e1906270 (diff) |
generic compat_sys_sigaltstack()
Again, conditional on CONFIG_GENERIC_SIGALTSTACK
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/x86/ia32')
-rw-r--r-- | arch/x86/ia32/ia32_signal.c | 50 | ||||
-rw-r--r-- | arch/x86/ia32/ia32entry.S | 1 |
2 files changed, 1 insertions, 50 deletions
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c index efc6a958b71d..a866411a2fcc 100644 --- a/arch/x86/ia32/ia32_signal.c +++ b/arch/x86/ia32/ia32_signal.c | |||
@@ -136,52 +136,6 @@ asmlinkage long sys32_sigsuspend(int history0, int history1, old_sigset_t mask) | |||
136 | return sigsuspend(&blocked); | 136 | return sigsuspend(&blocked); |
137 | } | 137 | } |
138 | 138 | ||
139 | asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr, | ||
140 | stack_ia32_t __user *uoss_ptr, | ||
141 | struct pt_regs *regs) | ||
142 | { | ||
143 | stack_t uss, uoss; | ||
144 | int ret, err = 0; | ||
145 | mm_segment_t seg; | ||
146 | |||
147 | if (uss_ptr) { | ||
148 | u32 ptr; | ||
149 | |||
150 | memset(&uss, 0, sizeof(stack_t)); | ||
151 | if (!access_ok(VERIFY_READ, uss_ptr, sizeof(stack_ia32_t))) | ||
152 | return -EFAULT; | ||
153 | |||
154 | get_user_try { | ||
155 | get_user_ex(ptr, &uss_ptr->ss_sp); | ||
156 | get_user_ex(uss.ss_flags, &uss_ptr->ss_flags); | ||
157 | get_user_ex(uss.ss_size, &uss_ptr->ss_size); | ||
158 | } get_user_catch(err); | ||
159 | |||
160 | if (err) | ||
161 | return -EFAULT; | ||
162 | uss.ss_sp = compat_ptr(ptr); | ||
163 | } | ||
164 | seg = get_fs(); | ||
165 | set_fs(KERNEL_DS); | ||
166 | ret = do_sigaltstack((stack_t __force __user *) (uss_ptr ? &uss : NULL), | ||
167 | (stack_t __force __user *) &uoss, regs->sp); | ||
168 | set_fs(seg); | ||
169 | if (ret >= 0 && uoss_ptr) { | ||
170 | if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t))) | ||
171 | return -EFAULT; | ||
172 | |||
173 | put_user_try { | ||
174 | put_user_ex(ptr_to_compat(uoss.ss_sp), &uoss_ptr->ss_sp); | ||
175 | put_user_ex(uoss.ss_flags, &uoss_ptr->ss_flags); | ||
176 | put_user_ex(uoss.ss_size, &uoss_ptr->ss_size); | ||
177 | } put_user_catch(err); | ||
178 | |||
179 | if (err) | ||
180 | ret = -EFAULT; | ||
181 | } | ||
182 | return ret; | ||
183 | } | ||
184 | |||
185 | /* | 139 | /* |
186 | * Do a signal return; undo the signal stack. | 140 | * Do a signal return; undo the signal stack. |
187 | */ | 141 | */ |
@@ -292,7 +246,6 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs) | |||
292 | struct rt_sigframe_ia32 __user *frame; | 246 | struct rt_sigframe_ia32 __user *frame; |
293 | sigset_t set; | 247 | sigset_t set; |
294 | unsigned int ax; | 248 | unsigned int ax; |
295 | struct pt_regs tregs; | ||
296 | 249 | ||
297 | frame = (struct rt_sigframe_ia32 __user *)(regs->sp - 4); | 250 | frame = (struct rt_sigframe_ia32 __user *)(regs->sp - 4); |
298 | 251 | ||
@@ -306,8 +259,7 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs) | |||
306 | if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) | 259 | if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) |
307 | goto badframe; | 260 | goto badframe; |
308 | 261 | ||
309 | tregs = *regs; | 262 | if (compat_restore_altstack(&frame->uc.uc_stack)) |
310 | if (sys32_sigaltstack(&frame->uc.uc_stack, NULL, &tregs) == -EFAULT) | ||
311 | goto badframe; | 263 | goto badframe; |
312 | 264 | ||
313 | return ax; | 265 | return ax; |
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 32e6f05ddaaa..102ff7cb3e41 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S | |||
@@ -464,7 +464,6 @@ GLOBAL(\label) | |||
464 | 464 | ||
465 | PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi | 465 | PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi |
466 | PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi | 466 | PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi |
467 | PTREGSCALL stub32_sigaltstack, sys32_sigaltstack, %rdx | ||
468 | PTREGSCALL stub32_execve, compat_sys_execve, %rcx | 467 | PTREGSCALL stub32_execve, compat_sys_execve, %rcx |
469 | PTREGSCALL stub32_fork, sys_fork, %rdi | 468 | PTREGSCALL stub32_fork, sys_fork, %rdi |
470 | PTREGSCALL stub32_vfork, sys_vfork, %rdi | 469 | PTREGSCALL stub32_vfork, sys_vfork, %rdi |