Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp821712imu; Mon, 5 Nov 2018 09:15:02 -0800 (PST) X-Google-Smtp-Source: AJdET5c0MuHVHJamIAbns13Y8x1ELGArtIq/2frMgtejXn0KXZ0J4KajK8QSeD4BaFJlB4S1Q4KC X-Received: by 2002:a63:d208:: with SMTP id a8mr20435570pgg.77.1541438102497; Mon, 05 Nov 2018 09:15:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541438102; cv=none; d=google.com; s=arc-20160816; b=ervjKwIU5hib4nRpNPA1b6SplvHx5kgUHNeGn0sOqMy5GQwkLfwyRZHqBxmWXtLXm8 M/AVZ9Ld96FsXt0Mtptku815Gzjg32OHCb4lFpxK8+1Q/1ymhCVQiNSwD7GkTk94PacQ C/Qt3bTSMJ4Dwa8t0Dh1ineGbJi6gGrm3Y1xtsNtfcQU6iFr/HFUFFj9BBea4Ke1jouz /OS/UFmNBmuHZcygsHIyyzPhz7nY35m4xQ1dn/x6+bjkOCOTCd5ypVgkLJcVIdR+Muc4 pDwmk2UWvDit6R/IyynbUgm3W1568aH7aikQfYo6ao5c+WZB3SCktsYevG+HXcHJKy9F WiWg== 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=DGkfvUd2KAwgbInO4J11UYOwTfHSLSyf6Y98z7lBqw0=; b=avICsZ8PKSOXYmMi2H8UTR9M8C6tTH2tWtBt9xDQnXMzvA4evxKoAM68AkLP9ZHegJ QWWWhWQHh1wiWV7JiCn47Gitl6NGLubyoUGTtUDsNVdCsl2RcpK/YDWc9nQCVVqubEnm nSUF20vICOlNvMEZucviQrcnQRYXDlaQMebAZwA+eX8aeZvre/cSc0tlbszjLnDRFJQE eenfReJmkh+AO9iw0yQn5+oJ38FTgiYXVTBY9oyXuAMPZ5VYrrnTnBCsYhv1s6wYkE44 YRM5sDCADVxA2X6sdUFKsk85doHpuYT1jLcPHhpkMV/t+2maJvgs/pL0GViQnuMHauHG h7gw== 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 s22-v6si59714163pfs.13.2018.11.05.09.14.42; Mon, 05 Nov 2018 09:15:02 -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 S2387559AbeKFCeS (ORCPT + 99 others); Mon, 5 Nov 2018 21:34:18 -0500 Received: from mga06.intel.com ([134.134.136.31]:14534 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729775AbeKFCeS (ORCPT ); Mon, 5 Nov 2018 21:34:18 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2018 09:13:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,468,1534834800"; d="scan'208";a="271539054" Received: from wenjiewa-mobl2.ccr.corp.intel.com (HELO localhost) ([10.249.254.60]) by orsmga005.jf.intel.com with ESMTP; 05 Nov 2018 09:13:35 -0800 Date: Mon, 5 Nov 2018 19:13:34 +0200 From: Jarkko Sakkinen To: Roberto Sassu Cc: Mimi Zohar , linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, silviu.vlasceanu@huawei.com Subject: Re: [PATCH v3 4/5] tpm: retrieve digest size of unknown algorithms with PCR read Message-ID: <20181105171334.GB4502@linux.intel.com> References: <20181030154711.2782-1-roberto.sassu@huawei.com> <20181030154711.2782-5-roberto.sassu@huawei.com> <1541088173.4035.26.camel@linux.ibm.com> <3034c896-788b-50f9-23cb-f4b2cd6363e6@huawei.com> <20181105120147.GA7621@linux.intel.com> <3b198ce9-9e2e-5290-bd40-e9a62da1f50d@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3b198ce9-9e2e-5290-bd40-e9a62da1f50d@huawei.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 Mon, Nov 05, 2018 at 02:09:12PM +0100, Roberto Sassu wrote: > On 11/5/2018 1:01 PM, Jarkko Sakkinen wrote: > > On Mon, Nov 05, 2018 at 10:47:19AM +0100, Roberto Sassu wrote: > > > > Commit?1db15344f874 ("tpm: implement TPM 2.0 capability to get active > > > > PCR banks") defined active_banks[7]. ?Subsequently, commit > > > > 4d23cc323cdb ("tpm: add securityfs support for TPM 2.0 firmware event > > > > log") defined TPM2_PCR_ACTIVE_BANKS as 3. ?I'm not sure which is the > > > > correct value, but the number of active_banks should not be hard coded > > > > here. > > > > > > Jarkko, should I change the value of TPM2_PCR_ACTIVE_BANKS, or set the > > > size of the active_banks array to TPM2_PCR_ACTIVE_BANKS? > > > > Hi, sorry I missed your patch set. Please add me either to 'To' or 'Cc' > > field of the email if you want a quick response. > > > > I think the implementation is flakky in both places and should be fixed > > before doing any other changes. Thanks James for pointing out these > > commits. > > > > What you need to do is to create a prequel commit that reads the number > > of banks to a variable e.g. > > > > unsigned int nr_active_banks; > > > > and allocate 'active_banks' dynamically and change the places that > > James pointed out. I guess it is OK to have a commit with two 'Fixes' > > tags. > > Ok, then I can remove patch 1/5 if nr_active_banks is included in the > tpm_chip structure. > > Roberto Yeah, I think it would be appropriate to have two fixes tags albeit it is arguable whether those are regressions (probably not, I guess inconsistency would be a better word) but I don't think they need to be cc'd to stable@vger.kernel.org. /Jarkko