From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932225AbeAWVI6 (ORCPT ); Tue, 23 Jan 2018 16:08:58 -0500 Received: from out03.mta.xmission.com ([166.70.13.233]:51868 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932085AbeAWVIz (ORCPT ); Tue, 23 Jan 2018 16:08:55 -0500 From: "Eric W. Biederman" To: linux-kernel@vger.kernel.org Cc: Al Viro , Oleg Nesterov , linux-arch@vger.kernel.org, Ram Pai , "Eric W. Biederman" Date: Tue, 23 Jan 2018 15:07:10 -0600 Message-Id: <20180123210719.10456-1-ebiederm@xmission.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <87607s5lra.fsf_-_@xmission.com> References: <87607s5lra.fsf_-_@xmission.com> X-XM-SPF: eid=1ee5oK-0003u7-QD;;;mid=<20180123210719.10456-1-ebiederm@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.121.88.104;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19Pjp93arwuLtHjXgGbJZAvs+GyuXOp/W0= X-SA-Exim-Connect-IP: 97.121.88.104 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;linux-kernel@vger.kernel.org X-Spam-Relay-Country: X-Spam-Timing: total 1200 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 2.8 (0.2%), b_tie_ro: 1.95 (0.2%), parse: 0.67 (0.1%), extract_message_metadata: 9 (0.8%), get_uri_detail_list: 0.81 (0.1%), tests_pri_-1000: 5 (0.4%), tests_pri_-950: 1.15 (0.1%), tests_pri_-900: 0.96 (0.1%), tests_pri_-400: 16 (1.3%), check_bayes: 15 (1.2%), b_tokenize: 4.4 (0.4%), b_tok_get_all: 4.0 (0.3%), b_comp_prob: 1.56 (0.1%), b_tok_touch_all: 3.2 (0.3%), b_finish: 0.57 (0.0%), tests_pri_0: 1158 (96.5%), check_dkim_signature: 0.46 (0.0%), check_dkim_adsp: 2.4 (0.2%), tests_pri_500: 3.7 (0.3%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH 01/10] ptrace: Use copy_siginfo in setsiginfo and getsiginfo X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that copy_siginfo copies all of the fields this is safe, safer (as all of the bits are guaranteed to be copied), clearer, and less error prone than using a structure copy. Signed-off-by: "Eric W. Biederman" --- kernel/ptrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/ptrace.c b/kernel/ptrace.c index ec4365da9be8..f3c82e26b995 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -659,7 +659,7 @@ static int ptrace_getsiginfo(struct task_struct *child, siginfo_t *info) if (lock_task_sighand(child, &flags)) { error = -EINVAL; if (likely(child->last_siginfo != NULL)) { - *info = *child->last_siginfo; + copy_siginfo(info, child->last_siginfo); error = 0; } unlock_task_sighand(child, &flags); @@ -675,7 +675,7 @@ static int ptrace_setsiginfo(struct task_struct *child, const siginfo_t *info) if (lock_task_sighand(child, &flags)) { error = -EINVAL; if (likely(child->last_siginfo != NULL)) { - *child->last_siginfo = *info; + copy_siginfo(child->last_siginfo, info); error = 0; } unlock_task_sighand(child, &flags); -- 2.14.1