Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1920269ybl; Sat, 1 Feb 2020 09:13:03 -0800 (PST) X-Google-Smtp-Source: APXvYqwAnZhNFn8hlbdClSdwwDp2rucG1ugPP6lnKxdYyjpCy/7y3ZUqPsGGPxqf3cIrpLW+eX7I X-Received: by 2002:a05:6830:160c:: with SMTP id g12mr11494355otr.82.1580577183526; Sat, 01 Feb 2020 09:13:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580577183; cv=none; d=google.com; s=arc-20160816; b=SkUGiiYlAt5d6vZ4qGq+j5TQw7difPZ0sY//E/76UzQbi2Unu71On4BWtiQW2wuFtE KM3UzwcVyrobbMCw0l49oG9e1yFhAluTcEeyBhWKsYZUbmGb7mW+n56a1pE9wWYFUsGs Et5TRbce+88tBJRL17cKdZ7Y6PlF905oOc7N1ya1O4/g/OMe4W8zcjE3cQj4L2zmJu4h 2tJHDyuh7DQumUGN+e3ONIVrSmYsoGiJrn8cF6vy8guCj+AkwiFTvuezDaoegZa4snD8 yGRjk+Ra2mTLDif7Y8cP2W0jSNzciX0VnfGB4gGgNiZ7DBnThHhub83O56ZOP+0iG3fw xYLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=etiV+wdMsiedo71XfbFrV1UXFT9pif6HVNi66kQ309c=; b=0GVw47kfqhV2jFBpUs9ZuT0CS3bY/JTGrCSkVaxF4jaJKa67js6vQcrzWIgbECDcMz ugVgUcXBF6XSc6Zh6bzWAEUrXvCUpdYYI5iYG26Bp1eUuRTFuiT7T6YASfQkfkuwtMu+ xmyRffxqhDTVV35MptN0ChZlpJj0mf0t2TTq0jUp+3SJN//zw+ivVUmwbVDdXc9RSzzN g4Vv34hSOrw3OwW+0kql7uLT7bUhAaAiAgpFvJSl/qGHmp6pQ8o90qGVzC7So61uNtmF CwUU4FQx4quG2hoPTUdkwC5Wt9uTZLzPm5yHuPuBvUusNp6gFkDw30WpwKoD7BJvveGj QrfA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si6802995otq.201.2020.02.01.09.12.51; Sat, 01 Feb 2020 09:13:03 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727084AbgBARKJ (ORCPT + 99 others); Sat, 1 Feb 2020 12:10:09 -0500 Received: from mga01.intel.com ([192.55.52.88]:55171 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726643AbgBARKI (ORCPT ); Sat, 1 Feb 2020 12:10:08 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2020 09:10:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,390,1574150400"; d="scan'208";a="218924370" Received: from mtaylo3-mobl1.ger.corp.intel.com (HELO localhost) ([10.251.87.188]) by orsmga007.jf.intel.com with ESMTP; 01 Feb 2020 09:10:05 -0800 Date: Sat, 1 Feb 2020 19:10:04 +0200 From: Jarkko Sakkinen To: Mimi Zohar Cc: Roberto Sassu , "james.bottomley@hansenpartnership.com" , "linux-integrity@vger.kernel.org" , "linux-security-module@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Silviu Vlasceanu Subject: Re: [PATCH 1/8] tpm: initialize crypto_id of allocated_banks to HASH_ALGO__LAST Message-ID: <20200201171004.GC14875@linux.intel.com> References: <20200127170443.21538-1-roberto.sassu@huawei.com> <20200127170443.21538-2-roberto.sassu@huawei.com> <50afe1f50297b02af52621b6738ffff0c24f1bdf.camel@linux.intel.com> <8c15cf66708a4d38916b8ca39f26b5f6@huawei.com> <1580477590.6104.61.camel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1580477590.6104.61.camel@linux.ibm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 31, 2020 at 08:33:10AM -0500, Mimi Zohar wrote: > On Thu, 2020-01-30 at 16:11 +0000, Roberto Sassu wrote: > > > -----Original Message----- > > > From: Jarkko Sakkinen [mailto:jarkko.sakkinen@linux.intel.com] > > > Sent: Thursday, January 30, 2020 9:48 AM > > > To: Roberto Sassu ; zohar@linux.ibm.com; > > > james.bottomley@hansenpartnership.com; linux-integrity@vger.kernel.org > > > Cc: linux-security-module@vger.kernel.org; linux-kernel@vger.kernel.org; > > > Silviu Vlasceanu > > > Subject: Re: [PATCH 1/8] tpm: initialize crypto_id of allocated_banks to > > > HASH_ALGO__LAST > > > > > > On Mon, 2020-01-27 at 18:04 +0100, Roberto Sassu wrote: > > > > chip->allocated_banks contains the list of TPM algorithm IDs of allocated > > > > PCR banks. It also contains the corresponding ID of the crypto subsystem, > > > > so that users of the TPM driver can calculate a digest for a PCR extend > > > > operation. > > > > > > > > However, if there is no mapping between TPM algorithm ID and crypto ID, > > > the > > > > crypto_id field in chip->allocated_banks remains set to zero (the array is > > > > allocated and initialized with kcalloc() in tpm2_get_pcr_allocation()). > > > > Zero should not be used as value for unknown mappings, as it is a valid > > > > crypto ID (HASH_ALGO_MD4). > > > > > > > > This patch initializes crypto_id to HASH_ALGO__LAST. > > > > > > > > Signed-off-by: Roberto Sassu --- > > > > > > Remarks: > > > > > > * After the subsystem tag, short summary starts with a capital lettter. > > > * Missing fixes tag and cc tag to stable. > > > * A struct called allocated_banks does not exist. > > > * Please prefer using an imperative sentence when describing the action > > > to take e.g. "Thus, initialize crypto_id to HASH_ALGO__LAST". > > > > Thanks. I will fix these issues in the next version of the patch set. > > Jarkko, I realize this is a TPM patch, but this patch set is dependent > on it. ?When this patch is ready, could you create a topic branch, > which both of us could merge? WFM. /Jarkko