summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2013-12-10 16:18:07 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-12-16 14:37:47 +0100
commit41932bc1c86e527f866acfcd26506da3bd20509b (patch)
treef7dde5097459e6f13db18cd1219ac1cc8b4df246
parent96619fc1b3d06703113ab4c5cd8c15f35a42dc99 (diff)
downloadop-kernel-dev-41932bc1c86e527f866acfcd26506da3bd20509b.zip
op-kernel-dev-41932bc1c86e527f866acfcd26506da3bd20509b.tar.gz
s390/compat: correct check for EFAULT in rt-signal frame creation
The return code of the __put_user call to store the rt_sigreturn system call to the user stack if not properly checked, the err variable is only checked before to the __put_user. Use an if statement instead. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/kernel/compat_signal.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index 95e7ba0..8b84bc3 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -412,8 +412,9 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info,
regs->gprs[14] = (__u64 __force) ka->sa.sa_restorer | PSW32_ADDR_AMODE;
} else {
regs->gprs[14] = (__u64 __force) frame->retcode | PSW32_ADDR_AMODE;
- err |= __put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn,
- (u16 __force __user *)(frame->retcode));
+ if (__put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn,
+ (u16 __force __user *)(frame->retcode)))
+ goto give_sigsegv;
}
/* Set up backchain. */
OpenPOWER on IntegriCloud