From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751789AbdA2PTS (ORCPT ); Sun, 29 Jan 2017 10:19:18 -0500 Received: from mga14.intel.com ([192.55.52.115]:28544 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751733AbdA2PTR (ORCPT ); Sun, 29 Jan 2017 10:19:17 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,306,1477983600"; d="scan'208";a="53543238" Date: Sun, 29 Jan 2017 17:19:04 +0200 From: Jarkko Sakkinen To: Nayna Cc: tpmdd-devel@lists.sourceforge.net, peterhuewe@gmx.de, tpmdd@selhorst.net, jgunthorpe@obsidianresearch.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 0/2] enhance TPM 2.0 extend function to support multiple PCR banks Message-ID: <20170129151903.v7mpbwqxll4ho73v@intel.com> References: <1484931913-24909-1-git-send-email-nayna@linux.vnet.ibm.com> <20170125204535.bduqiywtlvgidoj6@intel.com> <588B81FF.40606@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <588B81FF.40606@linux.vnet.ibm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 27, 2017 at 10:53:11PM +0530, Nayna wrote: > > > On 01/26/2017 02:15 AM, Jarkko Sakkinen wrote: > > On Fri, Jan 20, 2017 at 12:05:11PM -0500, Nayna Jain wrote: > > > IMA extends its hash measurements in the TPM PCRs, based on policy. > > > The existing in-kernel TPM extend function extends only the SHA1 > > > PCR bank. TPM 2.0 defines multiple PCR banks, to support different > > > hash algorithms. The TCG TPM 2.0 Specification[1] recommends > > > extending all active PCR banks to prevent malicious users from > > > setting unused PCR banks with fake measurements and quoting them. > > > This patch set adds support for extending all active PCR banks, > > > as recommended. > > > > > > The first patch implements the TPM 2.0 capability to retrieve > > > the list of active PCR banks. > > > > > > The second patch modifies the tpm_pcr_extend() and tpm2_pcr_extend() > > > interface to support extending multiple PCR banks. The existing > > > tpm_pcr_extend() interface expects only a SHA1 digest. Hence, to > > > extend all active PCR banks with differing digest sizes for TPM 2.0, > > > the SHA1 digest is padded with 0's as needed. > > > > > > [1] TPM 2.0 Specification referred here is "TCG PC Client Specific > > > Platform Firmware Profile for TPM 2.0" > > > > I pushed these patches. I had to resolve merge conflicts caused > > by the min_rsp_body_length parameter in tpm_transmit_cmd. Can you > > verify that I didn't break anything? > > > > Yes, it looks fine, also tested with it. > > Just to understand.. how did you decide min_rsp_body_length to be 9. > If I understood correctly, I think it is the size after header, till last > fixed parameter i.e. till count. > Is the assumption is that count can be zero, such that there is no active > bank for PCR and so no struct tpm2_pcr_selection ? > > Thanks & Regards, > - Nayna Hmm.. I got it from "marker = &buf.data[TPM_HEADER_SIZE + 9];" i.e. must have at last 9 bytes after the header. /Jarkko