Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp903158imm; Thu, 4 Oct 2018 05:22:05 -0700 (PDT) X-Google-Smtp-Source: ACcGV60n4O0JP/LOKWWsy86DHNbQjT5B0yOQt0DWjkVxkbgc42VzWcBskTjcA5BOW0VzO/qhdZvJ X-Received: by 2002:a17:902:bcc3:: with SMTP id o3-v6mr6538856pls.202.1538655725489; Thu, 04 Oct 2018 05:22:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538655725; cv=none; d=google.com; s=arc-20160816; b=uQSKtc4FFEAs+hhqW1dLL737HlFTpJDGf9piseeur03LQiCiV0oB01vXmvrdYuyUk4 DP0/pVZNlaLjtLpdIBcyIqjZBjks+6X8YxLxlRAvoe0XXhIqS526FGWTakt9d7iM3ukl 3WoTtVku5gPJ7TgNDoff9Rp6cb3Zde0FL9xyVAIQShCtcHOGgpJhimOYVxboEGt0qu8g yTBHoM3mpnlUbzSTbboRghh7aUGwZLpKAR1HhXrXrfL/Iqstf579qQfaMjp87KXtYqsp h6FepI96FEKBGYvsiMVdmMYm53ljxt/d5UnCoSXKgPtBRmWPGjp2GOoSPkwwbWSdZG2U XVOQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=LTRxvSUaiA/y3ufBgTD+49hjcHUtpvBE1Pi85cqXAhI=; b=O3b7XDFwoGnEa/feU+Qfa/5eojc0qpVgBYOp928meaz6HNsxd54v79v/kWMBPPFUab ippKHX1XscwN3EDRtCS3mx1K4QQR4glPHTGKKUQ8dexMdSCrUKg6sovzfdTlhvjTjG4d 9mCTenPUnKQc93EpkZgiGO9Ei54Ve38+CjodB2/Q5jZJvoU4g2mflYGRLx86EIYQofVR FjODa2l0qrSgmXsp9OnRPn/6QR6piuW+W+7If1y+1SnLv8C3Im91jRgrRZu/3EtmhkqP Njt6nSRrfi0XiDJO0uFsLTxdvsWCrtWumLs3gVFUWtIg0bNbFK3sJ7Dl6s82RVLR67M8 DYsg== 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 g12-v6si4639925pgi.467.2018.10.04.05.21.48; Thu, 04 Oct 2018 05:22:05 -0700 (PDT) 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 S1727596AbeJDTNx (ORCPT + 99 others); Thu, 4 Oct 2018 15:13:53 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2095 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727325AbeJDTNx (ORCPT ); Thu, 4 Oct 2018 15:13:53 -0400 Received: from LHREML711-CAH.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id 517163D3B2D1; Thu, 4 Oct 2018 13:20:48 +0100 (IST) Received: from [10.204.65.138] (10.204.65.138) by smtpsuk.huawei.com (10.201.108.34) with Microsoft SMTP Server (TLS) id 14.3.399.0; Thu, 4 Oct 2018 13:20:46 +0100 Subject: Re: [PATCH v5 12/21] tpm: move pcr extend code to tpm2-cmd.c To: "Winkler, Tomas" , Jarkko Sakkinen CC: Jason Gunthorpe , Nayna Jain , "Usyskin, Alexander" , "Struk, Tadeusz" , "linux-integrity@vger.kernel.org" , "linux-security-module@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20180928223035.14471-1-tomas.winkler@intel.com> <20180928223035.14471-13-tomas.winkler@intel.com> <20181002005208.GH23753@linux.intel.com> <5B8DA87D05A7694D9FA63FD143655C1B9D9DFAA5@hasmsx109.ger.corp.intel.com> <20181003120141.GA7969@linux.intel.com> <5B8DA87D05A7694D9FA63FD143655C1B9D9E5343@hasmsx109.ger.corp.intel.com> <20181004113502.GA12498@linux.intel.com> <5B8DA87D05A7694D9FA63FD143655C1B9D9E6D00@hasmsx109.ger.corp.intel.com> From: Roberto Sassu Message-ID: <19c26db0-cde9-da70-1b02-7e37ca188b45@huawei.com> Date: Thu, 4 Oct 2018 14:20:42 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <5B8DA87D05A7694D9FA63FD143655C1B9D9E6D00@hasmsx109.ger.corp.intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.204.65.138] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/4/2018 1:45 PM, Winkler, Tomas wrote: > > >> -----Original Message----- >> From: Jarkko Sakkinen [mailto:jarkko.sakkinen@linux.intel.com] >> Sent: Thursday, October 04, 2018 14:35 >> To: Winkler, Tomas >> Cc: Jason Gunthorpe ; Nayna Jain >> ; Usyskin, Alexander >> ; Struk, Tadeusz ; >> linux-integrity@vger.kernel.org; linux-security-module@vger.kernel.org; >> linux-kernel@vger.kernel.org; roberto.sassu@huawei.com >> Subject: Re: [PATCH v5 12/21] tpm: move pcr extend code to tpm2-cmd.c >> >> On Wed, Oct 03, 2018 at 10:24:09PM +0000, Winkler, Tomas wrote: >>> >>> >>>> -----Original Message----- >>>> From: Jarkko Sakkinen [mailto:jarkko.sakkinen@linux.intel.com] >>>> Sent: Wednesday, October 03, 2018 15:02 >>>> To: Winkler, Tomas >>>> Cc: Jason Gunthorpe ; Nayna Jain >>>> ; Usyskin, Alexander >>>> ; Struk, Tadeusz >>>> ; linux-integrity@vger.kernel.org; >>>> linux-security-module@vger.kernel.org; >>>> linux-kernel@vger.kernel.org; roberto.sassu@huawei.com >>>> Subject: Re: [PATCH v5 12/21] tpm: move pcr extend code to >>>> tpm2-cmd.c >>>> >>>> On Tue, Oct 02, 2018 at 04:58:25AM +0000, Winkler, Tomas wrote: >>>>> >>>>> >>>>>> >>>>>> On Sat, Sep 29, 2018 at 01:30:26AM +0300, Tomas Winkler wrote: >>>>>>> Add tpm2_pcr_extend() function to tpm2-cmd.c with signature >>>>>>> required by tpm-interface.c. It wraps the original open code >>>> implementation. >>>>>>> The original original tpm2_pcr_extend() function is renamed to >>>>>>> __tpm2_pcr_extend() and made static, it is called only from >>>>>>> new tpm2_pcr_extend(). >>>>>>> >>>>>>> Fix warnings in __tpm2_pcr_extend() >>>>>>> tpm2-cmd.c:251:16: warning: comparison between signed and >>>>>>> unsigned integer expressions [-Wsign-compare] >>>>>>> tpm2-cmd.c:252:17: warning: comparison between signed and >>>>>>> unsigned integer expressions [-Wsign-compare] >>>>>>> >>>>>>> Signed-off-by: Tomas Winkler >>>>>> >>>>>> We do not want the signature change, especially because as we >>>>>> are working on getting Roberto's changes in and also because it >>>>>> has absolutely a zero gain. Who cares if those functions take >>>>>> different >>>> parameters? I don't. >>>>> >>>>> Yes, we do care this series tries to have a clean cut between 1.x >>>>> and 2.x >>>> specs. Please, let's finish one transformation and then move to another. >>>>> I understand that Roberto will have to rebase anyhow, if this >>>>> series goes in >>>> first, if this is hard I can do it myself, it's trivial. >>>>> >>>>> Tomas >>>> >>>> I'm happy to tune this minor stuff. >>> What minor stuff? This patch is just okay, let's change the API in next >> round. >> >> The patch is not okay because it does a completely unnecessary API change. > > There is no API change, in that sense. > The exported API is in tpm-interface.c int tpm_pcr_extend(struct tpm_chip *chip, int pcr_idx, const u8 *hash) > that is used is outside of the tpm reminds the same, only the open coded implementation of tpm2_pcr_extned has moved to > tpm2-cmd.c, This code is not called out of tpm module. > Please review the code again. Hi Tomas I will update tpm_pcr_extend() by replacing the array of u8 with an array of tpm2_digest structures, so that the caller can provide multiple digests with one call. The array of tpm2_digest structures will be passed to tpm2_pcr_extend(). Please, don't modify the parameters of tpm2_pcr_extend(). Thanks Roberto -- HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063 Managing Director: Bo PENG, Jian LI, Yanli SHI