Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp784305ybh; Wed, 22 Jul 2020 13:11:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaYafUyvlfKq4Xjw2jDdL+xfvUFoMeRo4E2jYsyz5VP+oOpBT4K6i+Wy8mTY+qqq3Wrd9w X-Received: by 2002:a50:9b5d:: with SMTP id a29mr1134905edj.68.1595448696431; Wed, 22 Jul 2020 13:11:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595448696; cv=none; d=google.com; s=arc-20160816; b=jiKg3PIJV5/8BvplL1deGkBB3ABtEfKXmB1lXzywCnB2B686MJFgqS5Eu/GusnjqZB iXh3d0axg5XT8dotBMBANh5izBw+CJ/p5cvtCOdi9z0o3U8+V+Ah8ZlsBPYntnxxV7+y KUvFooJwdFxUwDejEfHGtQWSU/G+P2nBTm7mA2AZvUNfk8ujHpSLGbztvpLEpW9LX2jF GBoGWD5e8jmjl+Si1cSmaEXHuxsewDthX+ibmQGBZguOVDnWipiWMqjn76RYOnNsWnv9 kbPm0Tq1pUjWWhPjYj18jAR0xTMaMOeTT4/S1OtwjhtCkH9GbOCUhjUWukKLM3h4Ra1I x12w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=+z8Sjy8ZptOYQPBj+H820e2EKukutEsqDOT5iiJ3PDM=; b=h09OkBgi7OmwINjRbNjhYKHoDHdgLnDTO5ys3P5e9lnVbkIYAHnEYPyezMxvkNbocr GxySLVawDpsyC4kf1Yht5YM2y75V/8y2wS3mxUOuMAd6XnHC9Je3Uw8M21pE9Lc94aiB tBYCAbJjtsa394aPnkrbyBe1WmP58G0lZsVqRbmQu/0K65wLnxd7oVAJ7a5T32iHaKvz 6aXfb9TcOxBqzs2OdGTOCvo1XTMhztgsqZMjMx0dAjfeO9n2gVjYDF6WyHicMnOXmBPU pDXCcUOQLZpqy4bxjDhhOwDhvz4lh6ISGN2apY5G/JLA+UL9ddqD7QB72l+aTNBLsG6g s/sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="YFI/F6on"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si862641edn.145.2020.07.22.13.11.11; Wed, 22 Jul 2020 13:11:36 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="YFI/F6on"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726841AbgGVULD (ORCPT + 99 others); Wed, 22 Jul 2020 16:11:03 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:59227 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726564AbgGVULD (ORCPT ); Wed, 22 Jul 2020 16:11:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595448661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+z8Sjy8ZptOYQPBj+H820e2EKukutEsqDOT5iiJ3PDM=; b=YFI/F6onfTPy859uWiW4y+mYExQ6TcfQmCBeorkF4J6L6xqj70gQxQGv9n0DtlZVxTSuHp r1auikkcfi1FnatLezCbA2zDZZ299eGayp3hbuqTloxS11NQeqLJLFpsiWX5cfHMR75R8z +gaY6Ol1gx640keM/pPKpat4KZnG8C0= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-8-DATXNlbRMde62i8CrBzfFA-1; Wed, 22 Jul 2020 16:11:00 -0400 X-MC-Unique: DATXNlbRMde62i8CrBzfFA-1 Received: by mail-qk1-f199.google.com with SMTP id h4so2202968qkl.23 for ; Wed, 22 Jul 2020 13:11:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=+z8Sjy8ZptOYQPBj+H820e2EKukutEsqDOT5iiJ3PDM=; b=FE3usbBMpGDn0huTpwgRj+/+zNqj5OnMlVfHFbF+7+kBV2SglfSFxSngO7lh8VeZQW GYVulmYP6NPXqqWzAKaqggfJim8Bw6ELP73VYE9e1p+lzDrz5j7+uNwEzio8DQWxUXQD IATSO1pXgL06fB9sMVuVt4jVXD7EO7o5B0kV1ymOtXKYRiUJk82tVpvRBaPhqCS8/j76 oH8nKEKnNcZm6rfQD/+VNlgL/80ER35Xx+h4R1PX2Ly2bZDnFUTw5PDTXLK5A/yJ7p9O 6iwC+I8jvFiSPQO0gUpV4nNYSmgnrqBrAyXRMi5D2YO166svmDePqFxan4QlYAAH1CpF nXiA== X-Gm-Message-State: AOAM5301ECUu6ntGbDmjw9OKL0HrmupWuGJrOE+Wls4BECTnv/0C9ZuI YSNuTiZEFLfNVbm7rtCTSCWF2UoMgtaGj56d7Dn/9cIAh5fleGSjNTaOA3UneaJqYlsgrRorVW1 OfQBUQqm3fH59SVvytmpoW0iR X-Received: by 2002:a05:620a:230:: with SMTP id u16mr1636733qkm.387.1595448659274; Wed, 22 Jul 2020 13:10:59 -0700 (PDT) X-Received: by 2002:a05:620a:230:: with SMTP id u16mr1636711qkm.387.1595448659017; Wed, 22 Jul 2020 13:10:59 -0700 (PDT) Received: from trix.remote.csb (075-142-250-213.res.spectrum.com. [75.142.250.213]) by smtp.gmail.com with ESMTPSA id o2sm743539qkh.102.2020.07.22.13.10.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jul 2020 13:10:58 -0700 (PDT) Subject: Re: [PATCH v2] KEYS: remove redundant memset To: Joe Perches , 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 References: <20200722134610.31947-1-trix@redhat.com> <2bdd6b8ec731d180023d593b679afc66def19b4f.camel@perches.com> From: Tom Rix Message-ID: Date: Wed, 22 Jul 2020 13:10:56 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <2bdd6b8ec731d180023d593b679afc66def19b4f.camel@perches.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/22/20 1:02 PM, Joe Perches wrote: > 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. Yes > How is this appropriate for a Fixes: line? Removing unneeded code is not a fix? > >> 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;