From patchwork Wed Mar 29 18:40:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 744910 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vtc5N6sT9z9s2Q for ; Thu, 30 Mar 2017 05:40:24 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ctIW1-0001aS-RB; Wed, 29 Mar 2017 18:40:17 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ctIW0-0001aM-FZ for tpmdd-devel@lists.sourceforge.net; Wed, 29 Mar 2017 18:40:16 +0000 X-ACL-Warn: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5] helo=mx0a-001b2d01.pphosted.com) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1ctIVz-0007lA-1q for tpmdd-devel@lists.sourceforge.net; Wed, 29 Mar 2017 18:40:16 +0000 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2TIcpOR002461 for ; Wed, 29 Mar 2017 14:40:09 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0b-001b2d01.pphosted.com with ESMTP id 29gatnwfhw-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 29 Mar 2017 14:40:09 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 29 Mar 2017 12:40:07 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 29 Mar 2017 12:40:06 -0600 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2TIe6if15794654; Wed, 29 Mar 2017 11:40:06 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 43C7F6E040; Wed, 29 Mar 2017 12:40:06 -0600 (MDT) Received: from jarvis.ext.hansenpartnership.com (unknown [9.80.213.111]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTPS id 513176E03A; Wed, 29 Mar 2017 12:40:05 -0600 (MDT) From: James Bottomley To: Ken Goldman , tpmdd-devel@lists.sourceforge.net Date: Wed, 29 Mar 2017 14:40:02 -0400 In-Reply-To: References: X-Mailer: Evolution 3.16.5 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17032918-0012-0000-0000-000013F5C208 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006872; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000206; SDB=6.00840430; UDB=6.00413648; IPR=6.00618425; BA=6.00005248; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014855; XFM=3.00000013; UTC=2017-03-29 18:40:07 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17032918-0013-0000-0000-00004C93C159 Message-Id: <1490812802.5647.4.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-29_13:, , 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-1702020001 definitions=main-1703290156 X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. X-Headers-End: 1ctIVz-0007lA-1q Subject: Re: [tpmdd-devel] TPM resource manager - persistent objects should be global X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces@lists.sourceforge.net On Tue, 2017-03-28 at 17:39 -0400, Ken Goldman wrote: > I have a persistent object at 81000001. > > getcapability through /dev/tpm0 shows it. The same command through > /dev/tpmrm0 does not. This causes further problems in the > application. > > While transient objects are per connection, IMHO persistent objects > should be global. > > ~~ > > Warning: I think I'm using the latest TPM device driver from > > git://git.infradead.org/users/jjs/linux-tpmdd.git > > but I'm new to both git and kernel building, so I could be wrong. If > you think the above should work, it could be my error. It should work. It turns out the body mapping code is overzealous and errors out when it should just pass through. The same thing happens with the PCRs as well. This should fix it for both. James --- ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot diff --git a/drivers/char/tpm/tpm2-space.c b/drivers/char/tpm/tpm2-space.c index 009934269514..e2e059d8ffec 100644 --- a/drivers/char/tpm/tpm2-space.c +++ b/drivers/char/tpm/tpm2-space.c @@ -429,15 +429,11 @@ static int tpm2_map_response_body(struct tpm_chip *chip, u32 cc, u8 *rsp, data->handles[j] = cpu_to_be32(vhandle); j++; break; - case TPM2_HT_HMAC_SESSION: - case TPM2_HT_POLICY_SESSION: + + default: data->handles[j] = cpu_to_be32(phandle); j++; break; - default: - dev_err(&chip->dev, "%s: unknown handle 0x%08X\n", - __func__, phandle); - break; } }