From ca3a991771bc83e3a37dbc813a75f6f2bd5ee8d9 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 28 Jun 2013 09:49:46 -0400 Subject: [PATCH] --- yaml --- r: 377465 b: refs/heads/master c: 706b23bde27a391f0974df2a8351661770fa2e07 h: refs/heads/master i: 377463: d7a786be8c924f5b6a84fa31257c73b3ad129643 v: v3 --- [refs] | 2 +- trunk/kernel/ptrace.c | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index e00d1f295cb1..705602f1122b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bd2931b5cff6a3bf39bfe15fae051fb8229c0029 +refs/heads/master: 706b23bde27a391f0974df2a8351661770fa2e07 diff --git a/trunk/kernel/ptrace.c b/trunk/kernel/ptrace.c index aed981a3f69c..335a7ae697f5 100644 --- a/trunk/kernel/ptrace.c +++ b/trunk/kernel/ptrace.c @@ -665,20 +665,22 @@ static int ptrace_peek_siginfo(struct task_struct *child, if (unlikely(is_compat_task())) { compat_siginfo_t __user *uinfo = compat_ptr(data); - ret = copy_siginfo_to_user32(uinfo, &info); - ret |= __put_user(info.si_code, &uinfo->si_code); + if (copy_siginfo_to_user32(uinfo, &info) || + __put_user(info.si_code, &uinfo->si_code)) { + ret = -EFAULT; + break; + } + } else #endif { siginfo_t __user *uinfo = (siginfo_t __user *) data; - ret = copy_siginfo_to_user(uinfo, &info); - ret |= __put_user(info.si_code, &uinfo->si_code); - } - - if (ret) { - ret = -EFAULT; - break; + if (copy_siginfo_to_user(uinfo, &info) || + __put_user(info.si_code, &uinfo->si_code)) { + ret = -EFAULT; + break; + } } data += sizeof(siginfo_t);