Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp780402ybh; Wed, 22 Jul 2020 13:05:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1RDVXiQmQof6ucK/YyahwUe6uR6Q4We07cKXy4lryydkvQ7rVQmTrPHh9k+syxbrB6Bci X-Received: by 2002:a17:906:2b52:: with SMTP id b18mr1237148ejg.158.1595448314126; Wed, 22 Jul 2020 13:05:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595448314; cv=none; d=google.com; s=arc-20160816; b=tUPHBsdpiORbVj0wkf55B2Z2SXkYo8RqWBeP5EMt+Y4kiwQkjnwGX5vPAUABx6+ovn J5Usux+Qr2ECG5NXjZJfJU9GlGR8RRt42kYJ5ViwQaDAT8TKavFLuS88OleTtmTruLYU OXnm4s1EvBVWJhba6ipBmDER+a8Do9w3QV7dPUosjt1m3x2pV0y0q9ZYzgp37kA8gmvz td6YEknWCB2R17BKVvyvN3Dafsh/ZpaZqtQ40a+Uo2gk3kheoA82Qk159VRzirr7maa9 2oRONRtqJKMBVvAnHSUpuOinZqqoqOFQS4pA/mEyI6yt3Tqrl2T4QPP2izudWgUitOn8 vt0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=NA0DTBjrHvBFaMiYwggOYPizGbWKHjfp33gM0IWhR5k=; b=rbsOxJGLD2zLSYWCeC/1BQMJlw0gst5S7H+6gWlFUHnEXHiLqqBuquYCr0dDywzVi1 zgIIX966MS8xTiymyEE3v/WKbcTR7oFb5EYNuXD6tgNg5GEbdyU+0TRB47c+zIgLDFh3 HpX4cUmxPnTlXIe4ftgT3p3p2hhYo/92HR4AiCFTWNkpOadMrg9o/OgF04yl4EEYPEMI +BnASN40Pc0fL5IAFP8KtpJxJz7pC7XGEf2+Cp+wXuceTbNIBnsOX4MSLjWW1b0PXL8U +uRvolfs35985Md9cvluX0MmLelDJ8nyvtBAxVw62UxgHmqSrkAW201lDdCDaCao86cZ gdxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p25si611768edx.347.2020.07.22.13.04.51; Wed, 22 Jul 2020 13:05:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732662AbgGVUCd (ORCPT + 99 others); Wed, 22 Jul 2020 16:02:33 -0400 Received: from smtprelay0037.hostedemail.com ([216.40.44.37]:40610 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726462AbgGVUCd (ORCPT ); Wed, 22 Jul 2020 16:02:33 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id B60D41842C03F; Wed, 22 Jul 2020 20:02:30 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1434:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:2828:2894:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:4321:5007:7576:9108:10004:10400:10848:11026:11232:11658:11914:12043:12048:12296:12297:12438:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21080:21451:21627:30012:30054:30075:30080:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: force93_1a17f4e26f38 X-Filterd-Recvd-Size: 1832 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf16.hostedemail.com (Postfix) with ESMTPA; Wed, 22 Jul 2020 20:02:28 +0000 (UTC) Message-ID: <2bdd6b8ec731d180023d593b679afc66def19b4f.camel@perches.com> Subject: Re: [PATCH v2] KEYS: remove redundant memset From: Joe Perches To: trix@redhat.com, dhowells@redhat.com, jarkko.sakkinen@linux.intel.com, jmorris@namei.org, serge@hallyn.com, denkenz@gmail.com, marcel@holtmann.org Cc: keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 22 Jul 2020 13:02:27 -0700 In-Reply-To: <20200722134610.31947-1-trix@redhat.com> References: <20200722134610.31947-1-trix@redhat.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.3-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-07-22 at 06:46 -0700, trix@redhat.com wrote: > From: Tom Rix > > Reviewing use of memset in keyctrl_pkey.c > > keyctl_pkey_params_get prologue code to set params up > > memset(params, 0, sizeof(*params)); > params->encoding = "raw"; > > keyctl_pkey_query has the same prologue > and calls keyctl_pkey_params_get. > > So remove the prologue. > > Fixes: 00d60fd3b932 ("KEYS: Provide keyctls to drive the new key type ops for asymmetric keys [ver #2]") At best, this is a micro optimization. How is this appropriate for a Fixes: line? > diff --git a/security/keys/keyctl_pkey.c b/security/keys/keyctl_pkey.c [] > @@ -166,8 +166,6 @@ long keyctl_pkey_query(key_serial_t id, > struct kernel_pkey_query res; > long ret; > > - memset(¶ms, 0, sizeof(params)); > - > ret = keyctl_pkey_params_get(id, _info, ¶ms); > if (ret < 0) > goto error;