Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2450803imu; Mon, 19 Nov 2018 00:19:05 -0800 (PST) X-Google-Smtp-Source: AJdET5cgspIguA7+66HHTJwmFLseBu74Q03cTyXWB3Q2CwbdsOkC4uJ0265obZ2a94lT6rFLpLBd X-Received: by 2002:a63:ff62:: with SMTP id s34mr19360129pgk.325.1542615545281; Mon, 19 Nov 2018 00:19:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542615545; cv=none; d=google.com; s=arc-20160816; b=J1V75d+5Uh2UeAFm1Cis8Eljm2MeJYo1td9Ik0qrgQEsBLQ5WlZBDaWfIc0IzfW3v/ StXNC+cf6iV/TCZcEQ8hxfGMEvUXg8Gg2Kkl2i9x+FkZ5LpOHh9pQuHV+SrTygLbRoOJ NQ6rtyFE/jnVZbPUNaAxM5rMotWtSLBmgUMEet11glmcJtsNZ6oMS0OOFd2fC5S7vww0 rljPXNvnSrH4MXTaIEzLJCAeg48GHzsUj0Lp+rMFIv/BPfYX6hYDNAUVJ5defBzMw8gw RqyBGISw9RM4y1xbPOwd9WUXx9GjoYq+Ke8sXtD+PbuVSWNPNJbgPLWKn6X8Z+uvlP9L g32g== 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=XmQPDoclGVF2J/MAJ+LaUQEx3AywenEiBsF/aPFlghE=; b=M9zPFNvtwOpb5AK0U6/h35iuyL+ZxtfyPXXkkKCuaP1XVTXk3LEJ+WeEC6tPOYqIyU Jjm0QPTMQV6arb4LcegYec6QGXtyLqvnCPStb/Hg+eN1CAMq8vHr5bur7f5F2f359hSD 6Y+qhFlUE6QKQMIED8kMEyeOeD6DkGaH+h3uMtWm755aPem6Pa5u4x33R7CESKduew5N C/905TeiVkPqtic3dVtVIjs58rXE8VBvWIIrKnW0jBr1n5+xmt7/aqs3Xdj/ZGhmQpBd tyvSFKk3sep0pm6WS/8yYjNLcJT6seFDwk68I77YA6QNq5pxvtIK/M8F8tQr21Yej2/7 zwEw== 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 a28si43018398pgl.530.2018.11.19.00.18.49; Mon, 19 Nov 2018 00:19:05 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726948AbeKSSjr (ORCPT + 99 others); Mon, 19 Nov 2018 13:39:47 -0500 Received: from lhrrgout.huawei.com ([185.176.76.210]:32776 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726687AbeKSSjq (ORCPT ); Mon, 19 Nov 2018 13:39:46 -0500 Received: from LHREML711-CAH.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id 42754A2F000E7; Mon, 19 Nov 2018 08:16:50 +0000 (GMT) Received: from [10.204.65.144] (10.204.65.144) by smtpsuk.huawei.com (10.201.108.34) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 19 Nov 2018 08:16:46 +0000 Subject: Re: [PATCH v5 7/7] tpm: pass an array of tpm_bank_list structures to tpm_pcr_extend() To: Mimi Zohar , Jarkko Sakkinen CC: , , , , , References: <20181114153108.12907-1-roberto.sassu@huawei.com> <20181114153108.12907-8-roberto.sassu@huawei.com> <20181116150352.GA3612@linux.intel.com> <9c534ed1-7832-7a3b-3e69-5fcc25c565cc@huawei.com> <20181118072745.GA5897@linux.intel.com> <1542603470.4914.55.camel@linux.ibm.com> From: Roberto Sassu Message-ID: <26519f33-b5d6-c2c6-5179-c43f197f2cbd@huawei.com> Date: Mon, 19 Nov 2018 09:16:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <1542603470.4914.55.camel@linux.ibm.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.204.65.144] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/19/2018 5:57 AM, Mimi Zohar wrote: > On Sun, 2018-11-18 at 09:27 +0200, Jarkko Sakkinen wrote: >> On Fri, Nov 16, 2018 at 04:55:36PM +0100, Roberto Sassu wrote: >>> On 11/16/2018 4:03 PM, Jarkko Sakkinen wrote: >>>> On Wed, Nov 14, 2018 at 04:31:08PM +0100, Roberto Sassu wrote: >>>>> Currently, tpm_pcr_extend() accepts as an input only a SHA1 digest. >>>>> >>>>> This patch modifies the definition of tpm_pcr_extend() to allow other >>>>> kernel subsystems to pass a digest for each algorithm supported by the TPM. >>>>> All digests are processed by the TPM in one operation. >>>>> >>>>> If a tpm_pcr_extend() caller provides a subset of the supported algorithms, >>>>> the TPM driver extends the remaining PCR banks with the first digest >>>>> passed as an argument to the function. >>>> >>>> What is the legit use case for this? >>> >>> A subset could be chosen for better performance, or when a TPM algorithm >>> is not supported by the crypto subsystem. >> >> Doesn't extending a subset a security concern? > > Right, so instead of extending a subset of the allocated banks, all of > the allocated banks need to be extended, even for those banks that a > digest was not included.  This is no different than what is being done > today.  IMA is currently only calculating the SHA1 hash, padding the > digest with 0's, and extending the padded value(s) into all of the > allocated banks. The caller of tpm_pcr_extend() could pass a subset of the allocated banks, but the TPM driver extends all banks as before. Roberto > If there is a vulnerability with the hash algorithm, then any bank > extended with the padded/truncated digest would be susceptible. > > IMA will need to become TPM 2.0 aware, calculating and extending > multiple banks and define a new measurement list format containing the > multiple digests. > > Mimi > -- HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063 Managing Director: Bo PENG, Jian LI, Yanli SHI