From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751624AbdE3Nlj (ORCPT ); Tue, 30 May 2017 09:41:39 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:27876 "EHLO lhrrgout.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750902AbdE3Nlf (ORCPT ); Tue, 30 May 2017 09:41:35 -0400 Subject: Re: [Linux-ima-devel] [PATCH v2 4/5] keys, trusted: modify arguments of tpm_pcr_extend() To: Mimi Zohar , References: <20170505142152.29795-1-roberto.sassu@huawei.com> <20170505142152.29795-5-roberto.sassu@huawei.com> <1496115337.3841.485.camel@linux.vnet.ibm.com> <1496145961.3841.537.camel@linux.vnet.ibm.com> CC: , , , From: Roberto Sassu Message-ID: <1d7ac422-09c6-dbd9-91fd-edd6ba3b0eed@huawei.com> Date: Tue, 30 May 2017 15:41:13 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <1496145961.3841.537.camel@linux.vnet.ibm.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.220.96.113] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090202.592D767D.0048,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: f9b5a3bbef903f42b8499772488b54c8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/30/2017 2:06 PM, Mimi Zohar wrote: > On Tue, 2017-05-30 at 09:36 +0200, Roberto Sassu wrote: >> On 5/30/2017 5:35 AM, Mimi Zohar wrote: >>> On Fri, 2017-05-05 at 16:21 +0200, Roberto Sassu wrote: >>>> pcrlock() has been modified to pass the correct arguments >>>> to tpm_pcr_extend(): the pointer of a tpm2_digest structure containing >>>> a random value generated by tpm_get_random() and the size of the array (1). >>> >>> If the number of arguments is wrong, that means the patch that >>> introduced the change is not bi-sect safe. (This comment is >>> applicable to patch 5/5 too.) >> >> Jarkko (the TPM driver maintainer) asked me to not introduce >> a new function to pass multiple digests, but to modify >> the parameters of tpm_pcr_extend(). > > Since struct tpm2_digest is a static size, shouldn't we be able to > compute the number of digests? The length of 'hash' is not passed to tpm_pcr_extend(). The only way to avoid changing the number of parameters would be to pass a buffer whose format is the same of the event log format defined by TCG: ... Roberto -- HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063 Managing Director: Bo PENG, Qiuen PENG, Shengli WANG