Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1027495imm; Thu, 4 Oct 2018 07:10:30 -0700 (PDT) X-Google-Smtp-Source: ACcGV61lyFPBnbVDgc4ZNenwfVUi4A9Io2jUx/gVIIcXmXVQykbGOtKRJhdIrdu0YDwzJ/H7PzhB X-Received: by 2002:a62:fc13:: with SMTP id e19-v6mr6987499pfh.101.1538662230828; Thu, 04 Oct 2018 07:10:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538662230; cv=none; d=google.com; s=arc-20160816; b=jyHuS2OQvJZy3tEmdLx9Q0cIpx1+I5zyRFpMzwHPkKuncxXLs65/yEc0Ps3pQyIEUP r/3DlCiaCKVi+ADIPUF9g33EY/b4I3a2nyZY7b2yj010w3LZPfqIpoOASv7GQmUqOidd QTbp08dI9zJon6mp5lcd8VThehCDo2jeBQxCa/+mjJbhOvxoyBKmG5EPTrZUCIusxSBZ C61QriRuhzqyn2yGGS9QoZDY6el5E+0VTBbvzSdL6fSgH9s/e7gtDWll+FCL/M8zIBBq f3wHfM3ck3WdCwnBT1jBFPRHGS/i/hE6NJjKwNUPvvb4iYQV1wWWpfaojHML+0NrtoO0 HIFQ== 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=Bl/6B537j++2TMStxdwj5+DYi1Ybb3nCojnoe7HlrzI=; b=czV1LPGkkJFgVBWbnKaNjleqUS7x3HLuVp8iYqczy1PbiDfbQH5iKOLMFnNtJ21t2v 727XZ+af1aLq6cr+JdL6o4JSp5oeaALpkRKIzfIoXdCNJ4b5THxvcw/XAD9qmtkArApK UvHjq4+wL2cwz8j9/B9V5HGRKw1BNk1EsgxcgLM+1M1xsrZTMc0k1YFGJcn7NynuQY3t ZSdygwyPvOphGZumrTmOVtyt84NWFla3xVbzWb5SGgLDK4m4FSCDjoLnyYlaptQSMvOd gNgwyYWFP0nRUCKATC2vJaJLepve2ekj2asYxXi0WXzNOcBjqN7jpdmFqdqJCRNUvrVO MGyg== 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 c32-v6si4965100plj.272.2018.10.04.07.10.15; Thu, 04 Oct 2018 07:10:30 -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 S1727505AbeJDVDj (ORCPT + 99 others); Thu, 4 Oct 2018 17:03:39 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2096 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727369AbeJDVDj (ORCPT ); Thu, 4 Oct 2018 17:03:39 -0400 Received: from LHREML711-CAH.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id 8CC95D1BDADD8; Thu, 4 Oct 2018 15:10:06 +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 15:10:08 +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> <19c26db0-cde9-da70-1b02-7e37ca188b45@huawei.com> <5B8DA87D05A7694D9FA63FD143655C1B9D9E6E47@hasmsx109.ger.corp.intel.com> From: Roberto Sassu Message-ID: <1851e1d3-edc8-613d-00c3-dd3847f3ecd2@huawei.com> Date: Thu, 4 Oct 2018 16:10:07 +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: <5B8DA87D05A7694D9FA63FD143655C1B9D9E6E47@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 3:46 PM, Winkler, Tomas wrote: >> >> 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(). > > What about tpm1_pcr_extend/read()? tpm_pcr_extend/read() would pass to them the array of u8 from the tpm2_digest structure. Check this patch: [PATCH v2 2/3] tpm: modify tpm_pcr_read() definition to pass TPM hash algorithms Roberto -- HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063 Managing Director: Bo PENG, Jian LI, Yanli SHI