From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752849AbdAZOfH (ORCPT ); Thu, 26 Jan 2017 09:35:07 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60399 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752581AbdAZOfE (ORCPT ); Thu, 26 Jan 2017 09:35:04 -0500 Subject: Re: [PATCH v6 0/2] enhance TPM 2.0 extend function to support multiple PCR banks To: Jarkko Sakkinen References: <1484931913-24909-1-git-send-email-nayna@linux.vnet.ibm.com> <20170125204535.bduqiywtlvgidoj6@intel.com> <20170125233335.g5dmj43bgrulwmva@intel.com> 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 From: Nayna Date: Thu, 26 Jan 2017 20:04:24 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20170125233335.g5dmj43bgrulwmva@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17012614-0020-0000-0000-00000B304471 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006502; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000200; SDB=6.00812995; UDB=6.00396553; IPR=6.00590410; BA=6.00005091; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014057; XFM=3.00000011; UTC=2017-01-26 14:35:01 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17012614-0021-0000-0000-0000598CF33A Message-Id: <588A08F0.4070501@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-26_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701260146 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/26/2017 05:03 AM, Jarkko Sakkinen wrote: > On Wed, Jan 25, 2017 at 10:45:35PM +0200, 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? > > You have a bug in tpm2_get_pcr_allocation: > > rc = tpm_transmit_cmd(chip, buf.data, PAGE_SIZE, 9, 0, > "get tpm pcr allocation"); > if (rc < 0) > goto out; > > You do not handle TPM error. Can you send a fix for this ASAP? Oh!! Sure.. I see below fix should handle it. if (rc) goto out: Sending the patch... Thanks & Regards, - Nayna > > /Jarkko >