Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp503403ima; Fri, 1 Feb 2019 06:39:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN4bCT3jBhzS/tXnmq+dsxEMl463fWV7z66LQgiOKU9UZ+z54wANilQrOm/77IIzw4cftmMI X-Received: by 2002:a62:c21c:: with SMTP id l28mr39177047pfg.74.1549031955727; Fri, 01 Feb 2019 06:39:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549031955; cv=none; d=google.com; s=arc-20160816; b=n8Pf+dR5abnT2ta68jOVNl4v/2I7az4Of7dnQSV4Ja+h6uqCpYZKv/T32LX0vbe6LV USSV/H+upYzdSmWot2RDESCPgEMGTUnLCeR24Aq+HCn945ki/swqcbINv/rwnfDexBqU Z8xz3GLOwlo3KVjbo8CwXrPuwLVkocxKHBHm+nIvfmxAeUMgcT9x7qjaQEo0vbA+JWDj 5gTwBP4P4PrFoV+D0P80YKFlILMLrMk1Feg4dUNypRN2XcdYMsjH5nR+YEn67jO5fDbB InnCFZlAPNUHQd3sLzlxF4iqnO2G7NFWmh2N9NErsR3b1wJO2ExlqssmpXbUcs72TyCM FS+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:cc:to:from:subject; bh=W5kXqOaZ80tHzT57QbmgUkAFG+uTHGf6GaJ34TmbBvE=; b=cvJHcJFoUWFJ7UQauQVv3lCBJ0qrz/PpDY1cwsaJc+pR4spsSu6gPJ2EImDuvzPhfk ZS+B4r7gu0+YMoM54gQoK2b9HbqJTJubUhBHDRpYnsXw2zvm0ss0zYtRl/uPu1eE320X +J5JWPMfm4WdiuvNbRcs21YU/xU53UqhG2AWr5cCvseW3k5cBAl6GTfzhVjXINjiGnsx yxwhozXv1upQj+R3ZBJn5fT2D3xRQZSieA4jUbNZyKi62fc5P36oPMoOPtRZMOTzn4VE LHadxWf7/9FqxMMW4Xb3oC5GH3tTgyajIPoRw7vguL5px713rhs4Q85gmeHjXKzSE0ZD epEA== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si7498615pfg.121.2019.02.01.06.39.00; Fri, 01 Feb 2019 06:39:15 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729176AbfBAOda (ORCPT + 99 others); Fri, 1 Feb 2019 09:33:30 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34076 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726972AbfBAOda (ORCPT ); Fri, 1 Feb 2019 09:33:30 -0500 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x11ESkJD074164 for ; Fri, 1 Feb 2019 09:33:28 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0b-001b2d01.pphosted.com with ESMTP id 2qcpp8vm7g-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 01 Feb 2019 09:33:27 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 1 Feb 2019 14:33:26 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 1 Feb 2019 14:33:22 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x11EXL605833080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 1 Feb 2019 14:33:21 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 28146AE058; Fri, 1 Feb 2019 14:33:21 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E2990AE045; Fri, 1 Feb 2019 14:33:19 +0000 (GMT) Received: from localhost.localdomain (unknown [9.80.91.130]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 1 Feb 2019 14:33:19 +0000 (GMT) Subject: Re: [PATCH v9 6/6] tpm: pass an array of tpm_extend_digest structures to tpm_pcr_extend() From: Mimi Zohar To: Jarkko Sakkinen , Roberto Sassu Cc: david.safford@ge.com, monty.wiseman@ge.com, matthewgarrett@google.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, linux-kernel@vger.kernel.org, silviu.vlasceanu@huawei.com Date: Fri, 01 Feb 2019 09:33:09 -0500 In-Reply-To: <20190201134151.GF17861@linux.intel.com> References: <20190201100641.26936-1-roberto.sassu@huawei.com> <20190201100641.26936-7-roberto.sassu@huawei.com> <20190201133949.GE17861@linux.intel.com> <20190201134151.GF17861@linux.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19020114-0020-0000-0000-000003105383 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19020114-0021-0000-0000-000021615725 Message-Id: <1549031589.6993.7.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-01_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902010109 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-02-01 at 15:41 +0200, Jarkko Sakkinen wrote: > On Fri, Feb 01, 2019 at 03:39:49PM +0200, Jarkko Sakkinen wrote: > > On Fri, Feb 01, 2019 at 11:06:41AM +0100, Roberto Sassu wrote: > > > Currently, tpm_pcr_extend() accepts as an input only a SHA1 digest. > > > > > > This patch replaces the hash parameter of tpm_pcr_extend() with an array of > > > tpm_digest structures, so that the caller can provide a digest for each PCR > > > bank currently allocated in the TPM. > > > > > > tpm_pcr_extend() will not extend banks for which no digest was provided, > > > as it happened before this patch, but instead it requires that callers > > > provide the full set of digests. Since the number of digests will always be > > > chip->nr_allocated_banks, the count parameter has been removed. > > > > > > Due to the API change, ima_pcr_extend() and pcrlock() have been modified. > > > Since the number of allocated banks is not known in advance, the memory for > > > the digests must be dynamically allocated. To avoid performance degradation > > > and to avoid that a PCR extend is not done due to lack of memory, the array > > > of tpm_digest structures is allocated by the users of the TPM driver at > > > initialization time. > > > > > > Signed-off-by: Roberto Sassu > > > > Reviewed-by: Jarkko Sakkinen > > Tested-by: Jarkko Sakkinen > > I tested that this does not break TPM. I'd need someone to check that > this does not break IMA. After that, I'm ready to apply this series. Thanks! I just finished compiling, rebooting, and verifying the IMA boot-aggregate matches. While compiling, I saw some messages that "TPM_BUFSIZE is redefined" for tpm_i2c_infineon, tpm_i2c_nuvoton, and st33zp24.  Didn't look to see if this is a result of this patch set or not. The IMA boot-aggregate matches the PCRs. Tested-by: Mimi Zohar (on x86 for TPM 1.2 & PTT TPM 2.0)