Skip to content

Commit 57d563c

Browse files
author
Al Viro
committed
x86: ia32_setup_rt_frame(): consolidate uaccess areas
__copy_siginfo_to_user32() call reordered a bit. The rest folds nicely. Signed-off-by: Al Viro <[email protected]>
1 parent e239074 commit 57d563c

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

arch/x86/ia32/ia32_signal.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,9 @@ int ia32_setup_rt_frame(int sig, struct ksignal *ksig,
302302
{
303303
struct rt_sigframe_ia32 __user *frame;
304304
void __user *restorer;
305-
int err = 0;
306305
void __user *fp = NULL;
307306

308-
/* __copy_to_user optimizes that into a single 8 byte store */
307+
/* unsafe_put_user optimizes that into a single 8 byte store */
309308
static const struct {
310309
u8 movl;
311310
u32 val;
@@ -347,17 +346,11 @@ int ia32_setup_rt_frame(int sig, struct ksignal *ksig,
347346
* versions need it.
348347
*/
349348
unsafe_put_user(*((u64 *)&code), (u64 __user *)frame->retcode, Efault);
350-
user_access_end();
351-
352-
if (__copy_siginfo_to_user32(&frame->info, &ksig->info, false))
353-
return -EFAULT;
354-
if (!user_access_begin(&frame->uc.uc_mcontext, sizeof(struct sigcontext_32)))
355-
return -EFAULT;
356349
unsafe_put_sigcontext32(&frame->uc.uc_mcontext, fp, regs, set, Efault);
350+
unsafe_put_user(*(__u64 *)set, (__u64 *)&frame->uc.uc_sigmask, Efault);
357351
user_access_end();
358-
err |= __put_user(*(__u64 *)set, (__u64 __user *)&frame->uc.uc_sigmask);
359352

360-
if (err)
353+
if (__copy_siginfo_to_user32(&frame->info, &ksig->info, false))
361354
return -EFAULT;
362355

363356
/* Set up registers for signal handler */

0 commit comments

Comments
 (0)