From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Bottomley Subject: Re: TPM resource manager - persistent objects should be global Date: Wed, 29 Mar 2017 14:40:02 -0400 Message-ID: <1490812802.5647.4.camel@linux.vnet.ibm.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Ken Goldman , tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: tpmdd-devel@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 --- 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; } } ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot