From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759252AbdACN4U (ORCPT ); Tue, 3 Jan 2017 08:56:20 -0500 Received: from mga03.intel.com ([134.134.136.65]:60675 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757650AbdACN4C (ORCPT ); Tue, 3 Jan 2017 08:56:02 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,455,1477983600"; d="scan'208";a="918438637" Date: Tue, 3 Jan 2017 15:55:57 +0200 From: Jarkko Sakkinen To: Mimi Zohar Cc: Nayna Jain , linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, tpmdd-devel@lists.sourceforge.net Subject: Re: [tpmdd-devel] [PATCH v2 0/2] tpm: enhance TPM 2.0 extend function to support multiple PCR banks Message-ID: <20170103135557.tbscbmxxgaiylisk@intel.com> References: <1483124550-9529-1-git-send-email-nayna@linux.vnet.ibm.com> <20170102221550.pck4fwir77zss6lz@intel.com> <1483446469.2900.30.camel@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1483446469.2900.30.camel@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 Tue, Jan 03, 2017 at 07:27:49AM -0500, Mimi Zohar wrote: > On Tue, 2017-01-03 at 00:15 +0200, Jarkko Sakkinen wrote: > > On Fri, Dec 30, 2016 at 02:02:28PM -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. > > For this reason, the change is needed whether we're extending the SHA1 > bank or any of the other TPM 2.0 banks. > > > > 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. > > > > > > This approach is taken to maintain backwards compatibility for IMA > > > in order to continue working with both TPM 1.2 and TPM 2.0 without > > > any changes and still comply with TCG TPM 2.0 Specification[1]. > > > > What is the plan to improve IMA so that it can use better hash > > algorithms? For me this zero padding sounds like a hack. > > In one case, we'll be padding the SHA1 hash, while in the other cases we > would be truncating the hash. Unfortunately, the need to extend > multiple banks doesn't go away when IMA supports larger digests. > > Nayna, could you remove this [unnecessary] paragraph? OK, I think I got it. I'll try to test these patches before further reviewing. Thank you. > Mimi /Jarkko