Received: by 10.223.176.46 with SMTP id f43csp4699844wra; Tue, 23 Jan 2018 13:12:12 -0800 (PST) X-Google-Smtp-Source: AH8x227imIpLO9pwPis1rL3aGcLHWo8OA/NcntbF4+OYJznYdUBgN2JKnsMGsR8HoFLOTjXMIQXm X-Received: by 10.36.90.137 with SMTP id v131mr5961103ita.41.1516741932122; Tue, 23 Jan 2018 13:12:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516741932; cv=none; d=google.com; s=arc-20160816; b=L5RxELqNkY+TN3Qmbf6g2lALTQIXtgIxbGM/Lb2BKQ2ofbTTDonSuYb7+oXi+a0EEx tW1IiF8dGbhNsmsmivkDgT93gzKfwzhPTKCOn+LF/93nrK/oiLW5GyQE/ypNgfnd9U90 nAatzd1vWgh4SSRg0BiOFPpoPATY/omD0aX00AkCG+Nnawq3BCcnOQZMcowLbBLcdECj PyLcwePfdRSokzHswaHAdCRU0vwGyHKFDI8RhA2VcsNg/uMacq3KmeunPlXtNgX0rT/z Dd4oXp+5h3kaaMMJCFhyWM+QkP79Z07Jsy44359CEAoXfhfg9RIt2kSsyh5ZpsI0s7C6 9vVA== 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=T9Td/jxzogh+Ay16X7W6Cbp7k2yE6UrPyidzUQt0Pss=; b=eVgZYwnYJeMWBfkyFM5St/PuYCBxv4pMl2ES0l/QDLohDJA23T2SnjctJO2xwO6CAI RcfMZjk8zQ46D5bOuccANwkvP2+/CXiWsBzWAohZBHKUtBBUd/JYijee0vUxjXi5WsuR WQRCRDtfpq6O9lcHswHC6nV9gX0ufoFjYaz1fSeV/6Ux0P5uqRHPdHIrTaAYAwv3cWRU L6qbODt8BWxjZKN7wnAW3R0nr65+mHAN7Oh98dLn1z5XEsjZaUIByvQbzpqZibGTZpUL mE5AlSRlNygIpsaAEp0ngSOboAEOZRTlhpaeRLHi5zUzIX2PgFJgRQQbCS/co4wpAK0I aqQg== 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 v10si15765539iod.248.2018.01.23.13.11.58; Tue, 23 Jan 2018 13:12:12 -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 S932258AbeAWVJI (ORCPT + 99 others); Tue, 23 Jan 2018 16:09:08 -0500 Received: from out01.mta.xmission.com ([166.70.13.231]:46679 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932195AbeAWVJF (ORCPT ); Tue, 23 Jan 2018 16:09:05 -0500 Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1ee5oW-0001ax-Dz; Tue, 23 Jan 2018 14:09:04 -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 1ee5oU-0003u7-AM; Tue, 23 Jan 2018 14:09:04 -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:13 -0600 Message-Id: <20180123210719.10456-4-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=1ee5oU-0003u7-AM;;;mid=<20180123210719.10456-4-ebiederm@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.121.88.104;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18z00Oj5IlsfQYIjcvmlBFTR8C89sJhsHU= X-SA-Exim-Connect-IP: 97.121.88.104 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sa01.xmission.com X-Spam-Level: *** X-Spam-Status: No, score=3.6 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,TR_Symld_Words,TVD_RCVD_IP,T_TooManySym_01,T_TooManySym_02, T_TooManySym_03,T_TooManySym_04,T_TooManySym_05,XMNoVowels,XMSubLong autolearn=disabled version=3.4.0 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 TR_Symld_Words too many words that have symbols inside * 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 * [sa01 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.0 T_TooManySym_04 7+ unique symbols in subject * 0.0 T_TooManySym_05 8+ unique symbols in subject * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.0 T_TooManySym_03 6+ unique symbols in subject X-Spam-DCC: XMission; sa01 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ***;linux-kernel@vger.kernel.org X-Spam-Relay-Country: X-Spam-Timing: total 1769 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 3.0 (0.2%), b_tie_ro: 2.0 (0.1%), parse: 1.26 (0.1%), extract_message_metadata: 26 (1.5%), get_uri_detail_list: 3.2 (0.2%), tests_pri_-1000: 10 (0.6%), tests_pri_-950: 2.0 (0.1%), tests_pri_-900: 1.61 (0.1%), tests_pri_-400: 48 (2.7%), check_bayes: 47 (2.6%), b_tokenize: 13 (0.7%), b_tok_get_all: 7 (0.4%), b_comp_prob: 3.2 (0.2%), b_tok_touch_all: 21 (1.2%), b_finish: 0.82 (0.0%), tests_pri_0: 1663 (94.0%), check_dkim_signature: 0.87 (0.0%), check_dkim_adsp: 4.4 (0.2%), tests_pri_500: 8 (0.5%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH 04/10] signal: Replace memset(info,...) with clear_siginfo for clarity 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 The function clear_siginfo is just a nice wrapper around memset so this results in no functional change. This change makes mistakes a little more difficult and it makes it clearer what is going on. Signed-off-by: "Eric W. Biederman" --- arch/um/kernel/trap.c | 2 +- drivers/usb/core/devio.c | 4 ++-- kernel/seccomp.c | 2 +- kernel/time/posix-timers.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/um/kernel/trap.c b/arch/um/kernel/trap.c index 428644175956..b2b02df9896e 100644 --- a/arch/um/kernel/trap.c +++ b/arch/um/kernel/trap.c @@ -306,7 +306,7 @@ void relay_signal(int sig, struct siginfo *si, struct uml_pt_regs *regs) arch_examine_signal(sig, regs); - memset(&clean_si, 0, sizeof(clean_si)); + clear_siginfo(&clean_si); clean_si.si_signo = si->si_signo; clean_si.si_errno = si->si_errno; clean_si.si_code = si->si_code; diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index a3fad4ec9870..3f9bd3e4c373 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -595,7 +595,7 @@ static void async_completed(struct urb *urb) as->status = urb->status; signr = as->signr; if (signr) { - memset(&sinfo, 0, sizeof(sinfo)); + clear_siginfo(&sinfo); sinfo.si_signo = as->signr; sinfo.si_errno = as->status; sinfo.si_code = SI_ASYNCIO; @@ -2613,7 +2613,7 @@ static void usbdev_remove(struct usb_device *udev) wake_up_all(&ps->wait); list_del_init(&ps->list); if (ps->discsignr) { - memset(&sinfo, 0, sizeof(sinfo)); + clear_siginfo(&sinfo); sinfo.si_signo = ps->discsignr; sinfo.si_errno = EPIPE; sinfo.si_code = SI_ASYNCIO; diff --git a/kernel/seccomp.c b/kernel/seccomp.c index 5f0dfb2abb8d..3153c9ea51bf 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c @@ -515,7 +515,7 @@ void put_seccomp_filter(struct task_struct *tsk) static void seccomp_init_siginfo(siginfo_t *info, int syscall, int reason) { - memset(info, 0, sizeof(*info)); + clear_siginfo(info); info->si_signo = SIGSYS; info->si_code = SYS_SECCOMP; info->si_call_addr = (void __user *)KSTK_EIP(current); diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index ec999f32c840..75043046914e 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -462,7 +462,7 @@ static struct k_itimer * alloc_posix_timer(void) kmem_cache_free(posix_timers_cache, tmr); return NULL; } - memset(&tmr->sigq->info, 0, sizeof(siginfo_t)); + clear_siginfo(&tmr->sigq->info); return tmr; } -- 2.14.1