From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752377AbdAaNQN (ORCPT ); Tue, 31 Jan 2017 08:16:13 -0500 Received: from mga04.intel.com ([192.55.52.120]:47031 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752209AbdAaNPY (ORCPT ); Tue, 31 Jan 2017 08:15:24 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,315,1477983600"; d="scan'208";a="815411501" Date: Tue, 31 Jan 2017 15:15:17 +0200 From: Jarkko Sakkinen To: James Bottomley Cc: linux-security-module@vger.kernel.org, tpmdd-devel@lists.sourceforge.net, open list Subject: Re: [tpmdd-devel] [PATCH v2 1/2] tpm2: add session handle context saving and restoring to the space code Message-ID: <20170131131517.ewudypkagux2bg6e@intel.com> References: <1485563481.3229.39.camel@HansenPartnership.com> <1485563558.3229.41.camel@HansenPartnership.com> <20170129213957.zx6v6g42kwcabc6y@intel.com> <1485729418.2491.10.camel@HansenPartnership.com> <20170130214526.56e4ai2k6zhzvgy4@intel.com> <1485814477.2518.30.camel@HansenPartnership.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1485814477.2518.30.camel@HansenPartnership.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 Mon, Jan 30, 2017 at 02:14:37PM -0800, James Bottomley wrote: > On Mon, 2017-01-30 at 23:45 +0200, Jarkko Sakkinen wrote: > > On Sun, Jan 29, 2017 at 02:36:58PM -0800, James Bottomley wrote: > [...] > > > > 2. Can it really return both TPM_RC_HANDLE and > > > > TPM_RC_REFERENCE_H0? > > > > > > Yes, it seems that a session that doesn't exist (because it's been > > > flushed) then it returns TPM_RC_REFERNCE_H0, but if the context has > > > a sequence mismatch (because it's been flushed and reloaded) then > > > we get TPM_RC_HANDLE. > > > > > > James > > > > If it is flushed, wouldn't you just get TPM_RC_REFERENCE_H0 when you > > try to TPM2_ContextLoad? The "and reloaded" does not make sense to > > me. Once a session is flushed it cannot be reloaded. > > > > Maybe you meant to say "beause it's been saved and reloaded"? That > > would make more sense and fits better what I see in the Commands > > specification. > > I mean if you load a prior context instead of the current one for an > existing handle, effectively a replay, you get TPM_RC_HANDLE. > > James Thanks for clarifying this. /Jarkko