Received: by 10.223.176.46 with SMTP id f43csp4697919wra; Tue, 23 Jan 2018 13:10:14 -0800 (PST) X-Google-Smtp-Source: AH8x22784d7Jryq9R8ku3zzInKyaySfm8RjsEXnYtjCTcrnRXLUYPMFBJ059JmbjHyxEnmsL7Vtk X-Received: by 10.36.161.11 with SMTP id y11mr5565855ite.11.1516741814136; Tue, 23 Jan 2018 13:10:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516741813; cv=none; d=google.com; s=arc-20160816; b=d4SJcwU+1zqvHaC1x+kPo7roc/bQp1PyNHJ81UbERS6eiRXTq9LZnbaJT+rbP/1Sg+ 54zOiE7eFnYj+Gt4RuMmBrVX8gozIZQfoCk+vYlpSOe8d7pCWnMLMd+PdRl73D7TaahJ ghVV3lbwxN620BCwaVdUac6MNdpfD3G+V4bJoLu3z+KIjAVBqq4TioDXZSBsYta58UdF XHVh25IzpmVoum/ronuep6g/8uIsT2c0K/VMVUDHB4zqHt3aVXGH8bzz2zTgoRI/TbiX W8K5tSEJl08bqWoFrk2eUfY7B/9DC3T1qqfV6HMWNXxA3av9pWvYyLqGDSj1s1m287U/ HuFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=GYSuVKRiHVr0G3emMFshUepZhBCj1wQwHAh7QHp+j1w=; b=nBg/3uh76La0agjBqXOf4Cg39srviwWT7e2+VlOQE2XCMqg/+RGt03ojWoEQX0e0nB EpcPH0ARta9oEgsi1q2gOM+i69sieP2vYhYLrNbue4AQSeLgt/6h+nRGdQBRKo8jZJ7+ kDJyYRzOGnDKgBmIutvjGR0Rb2JqdsVqcmTDQis2+aGEzud6IwE+vur+zx3z9CjpwipK 6EDUhWuUA6MHZYt+NZHesK3dRRhhL6DuGmNxaNOArOmFsEYOT7j2s/oSuKpDdGcVdShu sgtWeHuapOShaL/JHJWILQhIuQcnR32Pn/8/P78qNGahVJnwCFN8I1GCfC6cZWr7+Xet C2wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p197si16209841iop.216.2018.01.23.13.10.00; Tue, 23 Jan 2018 13:10:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932220AbeAWVI6 (ORCPT + 99 others); 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 Received: from in01.mta.xmission.com ([166.70.13.51]) by out03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1ee5oM-0001O5-G6; Tue, 23 Jan 2018 14:08:54 -0700 Received: from 97-121-88-104.omah.qwest.net ([97.121.88.104] helo=x220.int.ebiederm.org) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1ee5oK-0003u7-QD; Tue, 23 Jan 2018 14:08:54 -0700 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-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa06.xmission.com X-Spam-Level: ** X-Spam-Status: No, score=2.0 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,TVD_RCVD_IP,T_TooManySym_01,XMNoVowels,XMSubLong autolearn=disabled version=3.4.1 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 Precedence: bulk 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